-
Notifications
You must be signed in to change notification settings - Fork 19
Track messages that successfully completed the message or error pipeline but failed to get acknowledged due to expired leases in receiveonly mode #1034
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bd315c2
to
42ba8e7
Compare
827009a
to
9032693
Compare
There is intermittent flakiness happening with the concurrency tests that got introduced recently. It also happens on master so it is quite likely not related to the changes proposed in this PR |
Requires a rebase after #1042 has been merged |
(cherry picked from commit 4bd949b)
9032693
to
d4621e4
Compare
soujay
approved these changes
Sep 23, 2024
TravisNickels
approved these changes
Sep 23, 2024
danielmarbach
added a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
added a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
added a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
added a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034) # Conflicts: # src/AcceptanceTests/NServiceBus.Transport.AzureServiceBus.AcceptanceTests.csproj # src/CommandLine/NServiceBus.Transport.AzureServiceBus.CommandLine.csproj # src/CommandLineTests/NServiceBus.Transport.AzureServiceBus.CommandLine.Tests.csproj # src/Tests/FakeReceiver.cs # src/Tests/NServiceBus.Transport.AzureServiceBus.Tests.csproj # src/Transport/NServiceBus.Transport.AzureServiceBus.csproj # src/TransportTests/NServiceBus.Transport.AzureServiceBus.TransportTests.csproj
danielmarbach
pushed a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
pushed a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
pushed a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
pushed a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
pushed a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
added a commit
that referenced
this pull request
Sep 24, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1034)
danielmarbach
added a commit
that referenced
this pull request
Sep 25, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1045) * Track messages that successfully completed the message or error pipeline but failed to get acknowledged due to expired leases in receiveonly mode (#1034) * Update src/AcceptanceTests/Receiving/When_message_visibility_expired.cs Co-authored-by: Travis Nickels <travis.nickels@particular.net> --------- Co-authored-by: Travis Nickels <travis.nickels@particular.net>
danielmarbach
added a commit
that referenced
this pull request
Sep 25, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1046) * Track messages that successfully completed the message or error pipeline but failed to get acknowledged due to expired leases in receiveonly mode (#1034) # Conflicts: # src/AcceptanceTests/NServiceBus.Transport.AzureServiceBus.AcceptanceTests.csproj # src/CommandLine/NServiceBus.Transport.AzureServiceBus.CommandLine.csproj # src/CommandLineTests/NServiceBus.Transport.AzureServiceBus.CommandLine.Tests.csproj # src/Tests/FakeReceiver.cs # src/Tests/NServiceBus.Transport.AzureServiceBus.Tests.csproj # src/Transport/NServiceBus.Transport.AzureServiceBus.csproj # src/TransportTests/NServiceBus.Transport.AzureServiceBus.TransportTests.csproj * Update src/AcceptanceTests/Receiving/When_message_visibility_expired.cs Co-authored-by: Travis Nickels <travis.nickels@particular.net> --------- Co-authored-by: Travis Nickels <travis.nickels@particular.net>
danielmarbach
added a commit
that referenced
this pull request
Sep 25, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1044) * Track messages that successfully completed the message or error pipeline but failed to get acknowledged due to expired leases in receiveonly mode (#1034) * Update src/AcceptanceTests/Receiving/When_message_visibility_expired.cs Co-authored-by: Travis Nickels <travis.nickels@particular.net> --------- Co-authored-by: Travis Nickels <travis.nickels@particular.net>
danielmarbach
added a commit
that referenced
this pull request
Sep 25, 2024
…ine but failed to get acknowledged due to expired leases in receiveonly mode (#1047) * Track messages that successfully completed the message or error pipeline but failed to get acknowledged due to expired leases in receiveonly mode (#1034) * Update src/AcceptanceTests/Receiving/When_message_visibility_expired.cs Co-authored-by: Travis Nickels <travis.nickels@particular.net> --------- Co-authored-by: Daniel Marbach <danielmarbach@users.noreply.github.com> Co-authored-by: Travis Nickels <travis.nickels@particular.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue:
receiveOnly
mode cannot forward messages to the error queue when handler execution exceeds message lock duration #1043This PR follows through on related changes done in Amazon SQS but adjusts the core pieces of the change to Azure Service Bus-specific behavior. Additionally, it brings in a number of layered tests that verify the code works as expected and doesn't accidentally break later.
An LRU cache to track the delivery attempts is not necessary because the receive count is automatically updated by the storage queue infrastructure.
The changes have only been applied for the receive only transaction mode because with the sends-atomic receive mode the outgoing messages are enlisted with a send-via information together with the incoming message. The outgoing messages are only sent when the incoming message successfully completed. In cases when the incoming message wasn't successfully completed, the outgoing operations are discarded by the broker and there is no way to refer to outgoing operations of a previous message handling attempt.
BitFaster.Caching.Lru
) is introduced to keep track of messages that have been marked as successfully completed. This helps in avoiding unnecessary retries for messages that are already acknowledged.Before ReceiveOnly
After ReceiveOnly
Tradeoffs
The tradeoffs are the sames as the other fixes applied in RabbitMQ and Amazon SQS. In competing consumer scenarios there can still be more retries because the LRU cache is in memory, but it is still marginally better than having a potentially unlimited number of retries.
As for the transaction mode
None
, there is no change required since we are not giving any guarantees there and messages are acknowledged early on withReceiveAndDelete
.Ideally at some point, if the complexity grows further, it would be good to split the pump into different receive strategies. Given the message settlement operations already had specific code around transport transaction modes and the risk of doing such a split is high a decision was made to not introduce a receive strategy and treat the settlement operation extensions as closesly related to the pump (hence they share the same logger)