From 9763bf8050a636ab4781c1b71539b6c0e089120b Mon Sep 17 00:00:00 2001 From: Abhishek Agarwal <1477457+abhishekagarwal87@users.noreply.github.com> Date: Thu, 20 Oct 2022 13:40:25 +0530 Subject: [PATCH] Fix race condition in HttpPostEmitter (#13237) --- .../apache/druid/java/util/emitter/core/HttpPostEmitter.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java b/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java index 7ec2a1e1afe..fd2387d977f 100644 --- a/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java +++ b/core/src/main/java/org/apache/druid/java/util/emitter/core/HttpPostEmitter.java @@ -534,11 +534,6 @@ public class HttpPostEmitter implements Flushable, Closeable, Emitter Object batch = concurrentBatch.get(); if (batch instanceof Batch) { ((Batch) batch).sealIfFlushNeeded(); - } else { - // batch == null means that HttpPostEmitter is terminated. Batch object might also be a Long object if some - // thread just failed with a serious error in onSealExclusive(). In this case we don't want to shutdown - // the emitter thread. - needsToShutdown = batch == null; } } return needsToShutdown;