Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: avoid caching invalid coordinators; allow retries
If a coordinator was still loading while FindCoordinator was issued, then it would return a node of -1, and we would cache that. Nothing would ever remove this from being cached, because we only cleaned up the cache when handling responses that indicated the coordinator was invalid. Since we never would issue a request to an invalid broker (-1), then we would never clean the cache. Now, we take a multi pronged approach: - If a broker func fails for the retriable type (that handles retrying requests), we now allow retries. Previously, we only retried on request failures, not on broker func failures. - We now collapse all duplicate coordinator loads into one request, rather than issuing repeated requests. All of these collapsed requests will use the same node / error as the first. - We now look at the FindCoordinatorResponse.ErrorCode. I'm not sure why I did not before. - If we load a coordinator but the broker does not exist, we now avoid caching that result. We avoid caching on any error.
- Loading branch information