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

Fix: websocket issues #426

Merged
merged 2 commits into from
May 1, 2023
Merged

Fix: websocket issues #426

merged 2 commits into from
May 1, 2023

Conversation

odesenfans
Copy link
Contributor

  • Avoid acknowledgement issues in message WS
  • Properly terminate requests to the message WS.

Problem: when a large number of websockets are open simultaneously,
at some point a message acknowledgement is not performed and
the channel/connection gets closed by the RabbitMQ broker.

Solution: use the WS in no_ack mode, we do not benefit from
acknowledgements in this use case anyway.
Problem: Websocket requests to api/ws0/messages never terminate,
resulting in resources leaking (ex: RabbitMQ queues).

Solution: split the implementation in two tasks:
* the main task reads the websocket and expects a `close` message.
* the secondary task publishes messages from the RabbitMQ queue
  to the websocket.

Once a close event is detected, the main task cancels the secondary
task and deletes the queue.
@odesenfans odesenfans merged commit f8688d3 into master May 1, 2023
@odesenfans odesenfans deleted the od-fix-websockets branch May 1, 2023 21:33
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.

1 participant