-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow broker session acquire timeout to propagate to acceptSession sync api #42838
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
Allow broker session acquire timeout to propagate to acceptSession sync api #42838
Conversation
|
API change check API changes are not detected in this pull request. |
3f489ba to
2ee331a
Compare
conniey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
...aging-servicebus/src/main/java/com/azure/messaging/servicebus/ServiceBusSessionAcquirer.java
Outdated
Show resolved
Hide resolved
f663718 to
310eb52
Compare
|
/azp run java - servicebus - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…ding cause as TimeoutException
|
/azp run java - servicebus - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Hi @anuchandy, My understanding is that |
The synchronous
acceptNextSessionmethod retries the session requests if the broker signals no session is available (broker-timeout). This retry loop continues until a session is available or a client-side timeout occurs. When client-side timeout happens, anIllegalStateExceptionwith a "timeout on blocking read for" message is thrown. It's impossible to cancel a sent session request. If the client-side timeout triggers after sending a session request, but the broker finds a session before broker-timeout, the session may be temporarily locked until the lock expires.To address this, synchronous
acceptNextSession(andacceptSession(sessionId)) has been updated to propagate the broker-timeout error. To avoid breaking change, library will continue to throwIllegalStateExceptionbut with cause asTimeoutException. The client-side timeout is still applied which is useful in case of any unexpected network delay.The
.block(timeout)method is replaced with a new chain:.timeout(timeout, Mono.error(..)).onErrorMap(..).block(). The new chain will continue to throw the same errorIllegalStateExceptionbut withTimeoutExceptionas the cause. In cases of broker-side timeout, the cause will beTimeoutException("com.microsoft:timeout"), while for client-side timeout, the cause will beTimeoutException("Timeout on blocking read for .. (client-timeout)").Also reduced the few log levels in ServiceBusSessionAcquirer to verbose from info.