Skip to content

Commit a63b608

Browse files
authored
fix thread leak (#15497)
1 parent 21ee53c commit a63b608

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,16 @@ public synchronized void handleExit() {
10681068
tsFileWriterCheckerFuture.cancel(false);
10691069
tsFileWriterCheckerFuture = null;
10701070
}
1071+
// shutdown executor
1072+
scheduledTsFileWriterCheckerPool.shutdownNow();
1073+
try {
1074+
if (!scheduledTsFileWriterCheckerPool.awaitTermination(30, TimeUnit.SECONDS)) {
1075+
LOGGER.warn("TsFileChecker did not terminate within {}s", 30);
1076+
}
1077+
} catch (InterruptedException e) {
1078+
LOGGER.warn("TsFileChecker Thread {} still doesn't exit after 30s", consensusPipeName);
1079+
Thread.currentThread().interrupt();
1080+
}
10711081
// Clear the tsFileWriters, receiverBuffer and receiver base dirs
10721082
requestExecutor.clear(false, true);
10731083
LOGGER.info("Receiver-{} exit successfully.", consensusPipeName.toString());

0 commit comments

Comments
 (0)