Skip to content
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

Merged
merged 2 commits into from
Nov 20, 2020

Conversation

DorothySun216
Copy link
Contributor

@DorothySun216 DorothySun216 commented Nov 17, 2020

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

@@ -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)
Copy link
Contributor Author

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);
Copy link
Contributor Author

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.

Copy link
Member

@serkantkaraca serkantkaraca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Member

@yvgopal yvgopal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ramya-rao-a
Copy link
Contributor

@JoshLove-msft Can you check if a similar change would be needed for Azure.Messaging.ServiceBus?

@JoshLove-msft
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants