azure-sdk-for-net
azure-sdk-for-net copied to clipboard
Retry Policy is not Respected
I am receiving this error message:
Azure.Messaging.ServiceBus.ServiceBusException: 'The operation did not complete within the allocated time 00:00:30 for object xxxxxxx.servicebus.windows.net:5671. (ServiceTimeout)'
notice the allocated time is 30 seconds. My retry policy:
var options = new ServiceBusClientOptions
{
TransportType = ServiceBusTransportType.AmqpTcp,
RetryOptions = new ServiceBusRetryOptions()
{
Mode = ServiceBusRetryMode.Exponential,
Delay = TimeSpan.FromSeconds(1),
MaxDelay = TimeSpan.FromSeconds(59),
MaxRetries = 10,
TryTimeout= TimeSpan.FromSeconds(59),
}
};
It is supposed to give an error that the allocated time is 00:00:59
If I change the value to anything less than 30 seconds, it works as expected. Please advise if 30 seconds is the maximum.
Thanks.
Won't repo. Post it under the client SDKs repo: https://github.com/Azure/azure-sdk-for-net/
Label prediction was below confidence level 0.6 for Model:ServiceLabels: 'Service Bus:0.5525177,Storage:0.17022647,Event Hubs:0.022390159'
Hi @xbaha. Therre's not much context for me to work from, but I'll do my best based on what's available. From the discussion, I believe what you're seeing is normal and expected behavior.
The TryTimeout is the interval allowed for all steps needed to perform the requested operation. In scenarios where multiple steps are needed - such as opening a connection/link to make the service request, the portion of the TryTimeout that is left after doing so is passed to the service as the limit for the operation itself. Often, differences like this are due to establishing the connection, link, and authorization needed for the operation. In your scenario, it may be this or it may be something else - there's not enough information to do more than speculate.
There's a couple of things that would be helpful to understand:
-
Can you let us know what version of the
Azure.Messaging.ServiceBuspackage you're using, and a bit about the host environment? -
Can you share more context around your application code? It would be helpful to understand what operation you're seeing this with and how the SDK is being used.
-
I'm not sure what is meant by "If I change the value to anything less than 30 seconds, it works as expected." Can you elaborate a bit on what you're seeing in that case?
-
A
ServiceTimeoutis a retriable error; if you're seeing that propagate to your application, that indicates all retries have been exhausted. That there's a disparity in this case may indicate a problem with being able to establish the connection. Can you collect verbose SDK logs for a +/- 2-minute period around the behavior?
Hi, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!