-
Notifications
You must be signed in to change notification settings - Fork 118
Renewal of messages is executed even if the message has been completed #591
Comments
If not a bug, at least it can be useful to make the information about this behavior available for others. |
I have run into this same issue. Looking at the source it seems like renew is a task that gets queued before the message comes in and only gets cancelled when the func has completely ended. Whats the solution to an issue like this? Or is this a bug? How do you "ack" a message with Azure ServiceBus using this |
Looking at the repro steps, it says:
At the same time, there's an explicit message auto-renewal.
Aren't those conflicting? Why would one complete the message, halt the callback, and have auto-renewal set -up? I'd expect to see auto-renewal used when auto-forwarding is used. Ti ensure that a long running processing callack has enough time to complete. Feels like API misunderstanding/misuse. |
@havarnov does my comment above clarifies not a bit more? |
@SeanFeldman that may be correct in this scenario. Though the default for the auto-renew is on and makes sense to be on. This feels like a bug to me anyways just because it's over-complicating what should be a simple API. Another scenario in which this definitely feels broken is If you do pre-fetch, and set auto-complete to false. You then want the renew to be there to ensure that the pre-fetched messages get renewed to avoid any issues, while you still want to complete it yourself to mark it as "acknowledged". In this scenario when you complete it you would want the renew to stop renewing inside of the func to avoid these errors. Example code:
|
@SeanFeldman that's why I said that this might not be a bug. Alltough @Kadajski example is more 'realistic' I guess. I think this should be fixed as I don't think this will have any negative effects. I'm happy to provide a PR as soon as I get time for it. |
@Kadajski @havarnov |
This might not be a bug, but misuse of the library.
Actual Behavior
Expected Behavior
Versions
The text was updated successfully, but these errors were encountered: