forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[client] Consider a timed-out lookup equivalent to TooManyRequests (a…
…pache#11688) Lookups and PartitionMetadataRequests(PMR) will get TooManyRequest if the broker they are talking to is making a lot of async requests to ZK and thus accepting and parking a lot of requests. This happens if there is a herding of clients requesting a lot of different topics. However, if there are few topics, the result will be cached and served synchronously. If a herd occurs under these conditions, clients will get a timeout as the i/o handler threads could be saturated and unable to serve the request in time. In certain scenarios, such as when the service url is a VIP or load balancer, the retry request will hit the exact same endpoint. If the broker serving is overloaded, or just plain broken, the client will get the same result. Lookups and PMR can be served by any broker, so it makes sense after a certain number of failures to try another broker. Closing the connection achieves this. There is a setting, ClientBuilder#maxNumberOfRejectedRequestPerConnection to close the connection when a threshold of rejected requests is reached. Thus far this considered only requests that got TooManyRequests responses to be rejected. This change adds Timeout to the list of "rejected" responses.
- Loading branch information
Showing
2 changed files
with
49 additions
and
10 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