[BUG] ServiceBusRetryOptions seems to be not working
See original GitHub issueLibrary name and version
Azure.Messaging.ServiceBus 7.6.0
Describe the bug
We recently experienced ServiceBus issues where after receiving a bunch of ServiceTimeout
exceptions noticed in application insights no retries.
We have ServiceBusRetryOptions
setup as follows for our client:
var serviceBusClientOptions = new ServiceBusClientOptions()
{
RetryOptions = new ServiceBusRetryOptions()
{
MaxRetries = 5,
Mode = ServiceBusRetryMode.Exponential,
MaxDelay = TimeSpan.FromSeconds(30),
TryTimeout = TimeSpan.FromSeconds(30)
}
};
And in application insights it is shown to only have taken 30s.
Expected behavior
Expect request duration to be longer as it should include all 5 retries.
Actual behavior
Request seems to return ServiceTimeout
exception after first attempt.
Reproduction Steps
Difficult to reproduce on demand.
Environment
Azure AppService .Net Version: 6.0.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Azure Service Bus Retry Options Not Working (v5.2.0)
When reading or publishing a message fails due to an error that is deemed transient, these settings are applied to client retries. This...
Read more >Troubleshooting guide for Azure Service Bus
This article provides troubleshooting tips and recommendations for a few issues that you may see when using Azure Service Bus.
Read more >Receiving messages from Azure Service Bus in C# - Ciaran O ...
A quick demo showing how to receive messages from Service Bus using C# and .NET.
Read more >Handling Azure Service Bus errors with .NET
Senders and Receivers handle errors on Azure Service Bus differently. We'll see how to catch them, what they mean and how to fix...
Read more >'Azure.Messaging.ServiceBus.ServiceBusExceptio' when ...
Hi We are getting stuck in what seems like an endless message loop, when trying to publish event using Azure Service Bus.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the additional context, @pjonusas. Unfortunately, the behavior that you’re seeing is expected in this scenario. Due to the way that transactions work with Service Bus, retries cannot be performed when there is an active ambient transaction. Looking over the docs, it seems that we did a poor job of calling this out. I’ve opened #27637 and #90071 to track getting retry guidance added.
I’m going to mark this as addressed, but please feel free to unresolve if you’d like to continue the discussion.
Hi @pjonusas, since you haven’t asked that we “
/unresolve
” the issue, we’ll close this out. If you believe further discussion is needed, please add a comment “/unresolve
” to reopen the issue.