mirror of https://github.com/apache/kafka.git
KAFKA-13917: Avoid calling lookupCoordinator() in tight loop (#12180)
Reviewers: Luke Chen <showuon@gmail.com>
This commit is contained in:
parent
e67408c859
commit
f8f57960c6
|
@ -1438,12 +1438,11 @@ public abstract class AbstractCoordinator implements Closeable {
|
||||||
// clear the future so that after the backoff, if the hb still sees coordinator unknown in
|
// clear the future so that after the backoff, if the hb still sees coordinator unknown in
|
||||||
// the next iteration it will try to re-discover the coordinator in case the main thread cannot
|
// the next iteration it will try to re-discover the coordinator in case the main thread cannot
|
||||||
clearFindCoordinatorFuture();
|
clearFindCoordinatorFuture();
|
||||||
|
|
||||||
// backoff properly
|
|
||||||
AbstractCoordinator.this.wait(rebalanceConfig.retryBackoffMs);
|
|
||||||
} else {
|
} else {
|
||||||
lookupCoordinator();
|
lookupCoordinator();
|
||||||
}
|
}
|
||||||
|
// backoff properly
|
||||||
|
AbstractCoordinator.this.wait(rebalanceConfig.retryBackoffMs);
|
||||||
} else if (heartbeat.sessionTimeoutExpired(now)) {
|
} else if (heartbeat.sessionTimeoutExpired(now)) {
|
||||||
// the session timeout has expired without seeing a successful heartbeat, so we should
|
// the session timeout has expired without seeing a successful heartbeat, so we should
|
||||||
// probably make sure the coordinator is still healthy.
|
// probably make sure the coordinator is still healthy.
|
||||||
|
|
Loading…
Reference in New Issue