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

Server may redeliver a message that has just been acknoweldged #1138

Closed
kozlovic opened this issue Jan 8, 2021 · 0 comments · Fixed by #1139
Closed

Server may redeliver a message that has just been acknoweldged #1138

kozlovic opened this issue Jan 8, 2021 · 0 comments · Fixed by #1139
Assignees
Labels

Comments

@kozlovic
Copy link
Member

kozlovic commented Jan 8, 2021

Normally, applications should acknowledge all messages that they receive, even if it is a redelivered message.
But if an application keeps track of which message the application has acknowledged and never call Ack() again on the same message, and if a race happens in the server, a message may be redelivered and added to the pending list and will always be redelivered.
Again, this would be a problem only for applications that use manual ack mode and do not ack a redelivered message that it believes has already been acknowledged.

@kozlovic kozlovic added the bug label Jan 8, 2021
@kozlovic kozlovic self-assigned this Jan 8, 2021
kozlovic added a commit that referenced this issue Jan 8, 2021
During redelivery, a go routine gathers all pending messages under
a lock. However, the actual send of messages is done one by one
and by then, one of the message in the list of messages to redeliver
may have been acknowledged. So during the send, under the sub's lock,
we need to check that if a message marked as redelivered is no longer
in the pending list, it should not be sent to the client.

Also fixed an unrelated data race that was just found running tests.

Resolves #1138

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
kozlovic added a commit that referenced this issue Jan 8, 2021
During redelivery, a go routine gathers all pending messages under
a lock. However, the actual send of messages is done one by one
and by then, one of the message in the list of messages to redeliver
may have been acknowledged. So during the send, under the sub's lock,
we need to check that if a message marked as redelivered is no longer
in the pending list, it should not be sent to the client.

Also fixed an unrelated data race that was just found running tests.

Resolves #1138

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
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 a pull request may close this issue.

1 participant