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 infinite loop in QueueMessageHandler #983

Merged
merged 3 commits into from
Dec 25, 2024
Merged

Conversation

bjsowa
Copy link
Collaborator

@bjsowa bjsowa commented Dec 22, 2024

Public API Changes
None

Description
It seems that when a client disconnects the following can happen:

  1. The rosbridge server calls protocol.finish()
  2. The protocol calls finish on all capabilities
  3. The subscribe capability calls unregister on all subscriptions
  4. The Subscription calls finish on all its message handlers
  5. The QueueMessageHandler tries to push all buffered messages but it never pops the message from the queue so it just pushes the same message in an infinite loop.

This PR fixes the QueueMessageHandler finishing by adding the missing queue popping (Thanks @daisukes for this contribution).

This should fix #891

@sea-bass sea-bass merged commit ffa2675 into ros2 Dec 25, 2024
6 checks passed
@sea-bass sea-bass deleted the fix/subscription-queue-loop branch December 25, 2024 15:17
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.

RosbridgeProtocol instance clean-up hangs when client disconnects under specific conditions.
2 participants