-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[BUG] Renewal of messages is executed even if the message has been completed #6723
Comments
//cc: @nemakam, @binzywu, @AlexGhiondea |
Here is a simple min viable repro: https://github.com/stewartadam/aspnet-servicebus-hostedservice Edit appsettings.json for your connection string/queue name, then simply The controller pushes a message on the bus, the IHostedService implementation will read the message on a background thread and complete it immediately, then wait 25 seconds. The long-running message handler completes as expected but Service Bus exceptions are printed about lock renewal failing, which should not happen for a message that was already completed. |
The background renewal doesn't know about the |
I'm completing it early on just to show what happens in the min viable repro - but as noted above the real-world scenario has a long-running task as the message handler so lock renewals are necessary. |
and, for clarity - if this is by design, we should document this so that users are aware this exception is expected when auto-renew is enabled. |
Describe the bug
Re-opening an issue for continued discussion of Azure/azure-service-bus-dotnet#591, where @havarnov did a great job describing current and expected behavior for long-running message handlers that explicitly ACK a message early on.
Exception or Stack Trace
To Reproduce
Steps to reproduce the behavior:
Code Snippet
See linked issue
Expected behavior
ExceptionReceivedHandler will not receive any exception as the RenewMessageTask should've been canceled.
Screenshots
Setup (please complete the following information):
Additional context
Add any other context about the problem here.
Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
The text was updated successfully, but these errors were encountered: