-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Convert "Invalid operation while connection is closing" to retriable ServiceBusException. #17023
Convert "Invalid operation while connection is closing" to retriable ServiceBusException. #17023
Conversation
@@ -263,5 +263,18 @@ public static Exception GetInnerException(this AmqpObject amqpObject) | |||
|
|||
return innerException == null ? null : GetClientException(innerException, null, null, connectionError); | |||
} | |||
|
|||
public static bool TryTranslateToRetriableException(Exception exception, out ServiceBusException retriableException) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize we don't have tests for this class and not sure if I should add a test for this method. I took this class from Serkant's PR fix.
} | ||
else | ||
{ | ||
throw AmqpExceptionHelper.GetClientException(exception, amqpLink?.GetTrackingId(), null, amqpLink?.Session.IsClosing() ?? false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neeraj once made a fix for this Github issue but not sure why it didn't resolve it and similar cases kept coming up: https://github.com/Azure/azure-sdk-for-net/pull/6940/files/1b6a6da7e95ecb0868691ae94948acaa27851b03
We have made sure their SDK had Neeraj's fix. Add the retriable exception to every place where this error might occur to attempt to resolve this incident.
sdk/servicebus/Microsoft.Azure.ServiceBus/src/MessageSession.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ServiceBusException. (Azure#17023) * add retriable exception * add helper class to AmqpExceptionHelper.GetClientException
@JoshLove-msft Can you check if a similar change would be needed for Azure.Messaging.ServiceBus? |
I believe this is being handled here - https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/servicebus/Azure.Messaging.ServiceBus/src/Amqp/AmqpConnectionScope.cs#L1109 |
Convert "Invalid operation while connection is closing" to retriable ServiceBusException so the SDK retry logic could kick in automatically.
Reference PR: #15984
Github Issues: #9416, #13637