Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shuts down server if internal websocket connections exceed max allowed defined in config #899

Merged
merged 2 commits into from
Feb 14, 2024

Conversation

aaronchongth
Copy link
Member

What's new

Implements an optional static limit to the number of internal websocket connections allowed. Supercedes #895

Temporary fix for #897

  • Removes WebsocketHealthManager, just uses ConnectionManager
  • New configurable parameter max_internal_websocket_connections. This value should be number of fleet adapters using BroadcastClient + number of task dispatchers

To test

  • add "max_internal_websocket_connections": 1, to packages/api-server/sqlite_local_config.py, we only allow one fleet adapter connection
  • launch office demo, ros2 launch rmf_demos_gz office.launch.xml server_uri:="ws://localhost:8000/_internal" headless:=1, this launches rmf_task_dispatcher without server connection at the moment
  • in a separate terminal start a new task dispatcher and provide it with the server URI, ros2 run rmf_task_ros2 rmf_task_dispatcher --ros-args -p use_sim_time:=true -p server_uri:="ws://localhost:8000/_internal"
  • The server will announce that the number of internal websocket connections was exceeded and shut down

Self-checks

  • I have prototyped this new feature (if necessary) on Figma
  • I'm familiar with and follow this Typescript guideline
  • I added unit-tests for new components
  • I tried testing edge cases
  • I tested the behavior of the components that interact with the backend, with an e2e test

@aaronchongth aaronchongth mentioned this pull request Feb 13, 2024
5 tasks
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: 216 lines in your changes are missing coverage. Please review.

Comparison is base (fe0e808) 49.35% compared to head (9366c0d) 74.77%.
Report is 60 commits behind head on deploy/hammer.

Files Patch % Lines
...es/api-server/api_server/models/delivery_alerts.py 12.94% 74 Missing ⚠️
...ckages/api-server/api_server/repositories/tasks.py 36.76% 43 Missing ⚠️
packages/api-server/api_server/authenticator.py 38.88% 22 Missing ⚠️
...es/api-server/api_server/routes/delivery_alerts.py 26.66% 22 Missing ⚠️
...ckages/api-server/api_server/routes/tasks/tasks.py 42.42% 19 Missing ⚠️
...-server/api_server/routes/tasks/scheduled_tasks.py 34.61% 17 Missing ⚠️
packages/api-server/api_server/dependencies.py 37.50% 5 Missing ⚠️
...pi_server/models/tortoise_models/scheduled_task.py 54.54% 5 Missing ⚠️
...ckages/api-server/api_server/rmf_io/book_keeper.py 78.57% 3 Missing ⚠️
packages/api-server/api_server/routes/internal.py 86.95% 3 Missing ⚠️
... and 2 more
Additional details and impacted files
@@                Coverage Diff                 @@
##           deploy/hammer     #899       +/-   ##
==================================================
+ Coverage          49.35%   74.77%   +25.42%     
==================================================
  Files                285      134      -151     
  Lines               7564     3279     -4285     
  Branches            1050        0     -1050     
==================================================
- Hits                3733     2452     -1281     
+ Misses              3682      827     -2855     
+ Partials             149        0      -149     
Flag Coverage Δ
api-server 74.77% <39.49%> (-6.03%) ⬇️
dashboard ?
react-components ?
rmf-auth ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Aaron Chong <[email protected]>
@aaronchongth aaronchongth merged commit 0374aa4 into deploy/hammer Feb 14, 2024
2 checks passed
@aaronchongth aaronchongth deleted the hammer/max-ws-connections branch February 14, 2024 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants