forked from Azure/azure-sdk-for-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Service Bus] Bug fix: batching receiver upon a disconnect (Azure#13374)
## Bug - `receiveMessages` method returned zero messages upon a connection refresh caused by a network disconnect(simulated in the test). - `OperationTimeout` error on message settlement after the disconnect These two failures made the "disconnect" test occasionally fail for the batching receiver. ## Cause `onDetached` on the batchReceivers is called 300ms after the connection refresh causing the recovered receive link to be closed. - If the message returned from the service took close to 300ms until reached the receiver since the refresh, `onDetached` is called to close the link leading to the loss of messages. - If the 300ms had elapsed right before the settlement, we'd see the OperationTimeout error on settlement since the receive link is closed. Investigated here Azure#13339 ## Fix - Call `onDetached` for the batching receivers before calling the refresh connection - And retain calling `onDetached` for the streaming receivers after the refresh connection ## Changes in the PR - [x] Refactored "calling onDetached" part - [x] Removed the 300ms delay since we don't see the utility - [x] Changelog - [x] TODO: What to do for sessions? - [x] Needs more investigation Azure#13374 (comment), will be handled at Azure#8875
- Loading branch information
1 parent
579d065
commit 6cda731
Showing
3 changed files
with
110 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters