set the rejoinNeeded in listener's onSuccess
@@ -398,6 +398,7 @@ public abstract class AbstractCoordinator implements Closeable {
synchronized (AbstractCoordinator.this) {
log.info("Successfully joined group {} with generation {}", groupId, generation.generationId);
state = MemberState.STABLE;
+ rejoinNeeded = false;
if (heartbeatThread != null)
heartbeatThread.enable();
@@ -536,7 +537,6 @@ public abstract class AbstractCoordinator implements Closeable {
if (error == Errors.NONE) {
sensors.syncLatency.record(response.requestLatencyMs());
future.complete(syncResponse.memberAssignment());
- AbstractCoordinator.this.rejoinNeeded = false;
} else {
requestRejoin();
