-
Notifications
You must be signed in to change notification settings - Fork 120
System.ObjectDisposedException thrown by MessageReceiver.OnReceiveAsync #599
Comments
I've seen the same thing, I've also seen. exception: "Microsoft.Azure.ServiceBus.MessageLockLostException: The lock supplied is invalid. Either the lock expired, or the message has already been removed from the queue, or was received by a different receiver instance. at Microsoft.Azure.ServiceBus.Core.MessageReceiver.DisposeMessagesAsync(IEnumerable |
On the other hand, |
So it’s normal to get the message lock in the receive error handler instead of a message in the receive handler? Seems like some internal logic underneath dropped the ball to me for that to happen. |
Could you please share a repro or a sample code to look at? The devil is in details, as we all know. |
See below. Every once in a while, very random, The ReceiveExceptionAsync handler gets called with the MessageLockLostException like something internal went wrong listening on the subscription. This is with no message being received from ReceiveAsync handler.
|
Can you log aside from exception also details such as what operation caused error handler to be invoked? |
I don't understand, it was just sitting there subscribed you can from the stack it was in some message pump code. See below for the operation that sets up the error handler to be invoked.
|
|
ObjectDisposedException with type "$cbs" means the underlying AMQP connection is closing while a put-token request is being made. OperationCanceledException may be a better exception type for this error condition. In a later major release of the AMQP library we are going to change the exception type. For now the application or upper layer SDK needs to handle ObjectDisposedException and retry. |
@xinchen10 I'd almost want to see ASB client handling this and throwing |
What is it that as consumers of this library we should do when encountering this exception? It seems as this is just a transient issue and we don't need to retry explicitly? @xinchen10 looks like you are part of the Azure AMQP library so I'm thinking that the retry comment was for this library to handle. |
Actual Behavior
Expected Behavior
Versions
The text was updated successfully, but these errors were encountered: