Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ServiceBus] wait up to max wait time for draining credit when receiv…
…ing messages (Azure#28604) We added a timeout of 200 milliseconds on credit draining before returning from `receiveMessages()`. There's customer report that indicates this timeout is aggressive in environment with slow network and caused link churn because we close link when draining times out to avoid going into a bad state. This PR changes the wait time to the max of 200 ms and the remaining portion of the `maxWaitTimeInMs` option that is passed to `receiveMessages()`, allowing customer to customize the time out indirectly. ### Packages impacted by this PR `@azure/service-bus` ### Issues associated with this PR Azure#28023 ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? - exposing an option to set drain timeout. This is not desired since waiting for draining is an internal implementation detail - increase 200 ms to some other higher value. It's not possible to determin a best value for this as environments are different. - adaptive behavior that adjust the wait time dynamically based on how frequently the link was closed due to time out. This can leads to complicate logic.
- Loading branch information