Content-Length: 331356 | pFad | http://github.com/Azure/azure-sdk-for-net/pull/50394

26 [Service Bus] Retry when throttled with short try by jsquire · Pull Request #50394 · Azure/azure-sdk-for-net · GitHub
Skip to content

[Service Bus] Retry when throttled with short try #50394

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

Merged
merged 2 commits into from
Jun 4, 2025

Conversation

jsquire
Copy link
Member

@jsquire jsquire commented Jun 3, 2025

Summary

The focus of these changes is to improve the retry logic in the Service Bus SDK when throttling occurs. Behavior has been adjusted to allow short TryTimeout configurations to consume retries when waiting for service throttling rather than triggering an immediate ServiceBusy exception.

References and related

The focus of these changes is to improve the retry
logic in the Service Bus SDK when throttling occurs.
Behavior has been adjusted to allow short `TryTimeout`
configurations to consume retries when waiting
for service throttling rather than triggering an
immediate `ServiceBusy` exception.
@jsquire jsquire added this to the 2025-06 milestone Jun 3, 2025
@jsquire jsquire requested review from christothes and m-redding June 3, 2025 21:39
@jsquire jsquire self-assigned this Jun 3, 2025
@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 21:39
@jsquire jsquire requested a review from jeo02 as a code owner June 3, 2025 21:39
@jsquire jsquire added the Client This issue points to a problem in the data-plane of the library. label Jun 3, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the Service Bus SDK retry logic to better handle throttling when a short TryTimeout is configured. In summary, the changes include:

  • Adding tests to validate retry behavior during server busy conditions.
  • Refactoring the retry logic in ServiceBusRetryPolicy to loop until the busy state clears or retries are exhausted.
  • Making minor code style improvements, such as marking constants as readonly.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
sdk/servicebus/Azure.Messaging.ServiceBus/tests/Primitives/ServiceBusRetryPolicyTests.cs Added tests validating retry logic during server busy conditions using test helper classes.
sdk/servicebus/Azure.Messaging.ServiceBus/src/Primitives/ServiceBusRetryPolicy.cs Updated the retry loop logic to handle server busy scenarios, including recalculating try timeouts and delays.
sdk/servicebus/Azure.Messaging.ServiceBus/src/Core/BasicRetryPolicy.cs Changed MaximumTimeSpanSeconds to a readonly field for consistency.
sdk/servicebus/Azure.Messaging.ServiceBus/CHANGELOG.md Updated changelog documentation to reflect the new retry behavior.

@jsquire
Copy link
Member Author

jsquire commented Jun 4, 2025

/azp run net - servicebus - tests

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jsquire jsquire merged commit 7abd009 into Azure:main Jun 4, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Service Bus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/Azure/azure-sdk-for-net/pull/50394

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy