mirror of https://github.com/apache/kafka.git
MINOR: Fix ConsumerNetworkThread shutdown (#14913)
This patch fixes a race condition in the shutdown logic of the `ConsumerNetworkThread`. The `running` variable could be set to `true` after `closeInternal` was called. Reviewers: Andrew Schofield <aschofield@confluent.io>, Lucas Brutschy <lbrutschy@confluent.io>
This commit is contained in:
parent
bbe87322e6
commit
ddf99880d7
|
@ -78,13 +78,11 @@ public class ConsumerNetworkThread extends KafkaThread implements Closeable {
|
||||||
this.applicationEventProcessorSupplier = applicationEventProcessorSupplier;
|
this.applicationEventProcessorSupplier = applicationEventProcessorSupplier;
|
||||||
this.networkClientDelegateSupplier = networkClientDelegateSupplier;
|
this.networkClientDelegateSupplier = networkClientDelegateSupplier;
|
||||||
this.requestManagersSupplier = requestManagersSupplier;
|
this.requestManagersSupplier = requestManagersSupplier;
|
||||||
|
this.running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
closer.assertOpen("Consumer network thread is already closed");
|
|
||||||
running = true;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.debug("Consumer network thread started");
|
log.debug("Consumer network thread started");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue