KAFKA-18805: add synchronized block for Consumer Heartbeat close (#18920)

add synchronized block for Consumer Heartbeat close.

Reviewers: Luke Chen <showuon@gmail.com>
This commit is contained in:
Ken Huang 2025-02-17 14:38:20 +08:00 committed by GitHub
parent 85c337af44
commit d1db3d8e14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1577,7 +1577,9 @@ public abstract class AbstractCoordinator implements Closeable {
this.failed.set(new RuntimeException(e));
} finally {
log.debug("Heartbeat thread has closed");
this.closed = true;
synchronized (AbstractCoordinator.this) {
this.closed = true;
}
}
}