Skip to content

Commit

Permalink
Removing fixed delay in retry after timeout exceptions when getting a…
Browse files Browse the repository at this point in the history
… new session receive link (#33856)
  • Loading branch information
ki1729 authored Mar 8, 2023
1 parent c9ceb82 commit 5b16f2d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions sdk/servicebus/azure-messaging-servicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
### Breaking Changes

### Bugs Fixed
- Removed delay in acquiring new link after timeout exception in `ServiceBusSessionManager`. ([#32455](https://github.com/Azure/azure-sdk-for-java/issues/32455))

### Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
*/
class ServiceBusSessionManager implements AutoCloseable {
// Time to delay before trying to accept another session.
private static final Duration SLEEP_DURATION_ON_ACCEPT_SESSION_EXCEPTION = Duration.ofMinutes(1);
private static final String TRACKING_ID_KEY = "trackingId";

private static final ClientLogger LOGGER = new ClientLogger(ServiceBusSessionManager.class);
Expand Down Expand Up @@ -298,10 +297,10 @@ Mono<ServiceBusReceiveLink> getActiveLink() {
return Mono.<Long>error(new AmqpException(false, "SessionManager is already disposed.", failure,
getErrorContext()));
} else if (failure instanceof TimeoutException) {
return Mono.delay(SLEEP_DURATION_ON_ACCEPT_SESSION_EXCEPTION);
return Mono.empty(); // Retry always
} else if (failure instanceof AmqpException
&& ((AmqpException) failure).getErrorCondition() == AmqpErrorCondition.TIMEOUT_ERROR) {
return Mono.delay(SLEEP_DURATION_ON_ACCEPT_SESSION_EXCEPTION);
return Mono.empty(); // Retry always
} else {
final long id = System.nanoTime();
LOGGER.atInfo()
Expand Down

0 comments on commit 5b16f2d

Please sign in to comment.