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

Fixes #569: NoSuchElementException in Session.drainQueueToConnection #570

Merged

Conversation

hylkevds
Copy link
Collaborator

@hylkevds hylkevds commented Feb 2, 2021

Session.drainQueueToConnection checks sessionQueue.isEmpty(), and then
uses sessionQueue.remove(). However, between the check and the remove,
another thread can steal the last message, causing the remove() to throw
an exception. Better to use sessionQueue.poll() with a null-check.

…Connection

Session.drainQueueToConnection checks sessionQueue.isEmpty(), and then
uses sessionQueue.remove(). However, between the check and the remove,
another thread can steal the last message, causing the remove() to throw
an exception. Better to use sessionQueue.poll() with a null-check.
@andsel andsel merged commit 55d8d4c into moquette-io:master May 1, 2021
@andsel andsel added the v0.15.0 label May 8, 2021
@hylkevds hylkevds deleted the fix_569_session_drainqueue branch May 9, 2021 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants