From ab74475c3f70d52ec98ef236f44c84644655c083 Mon Sep 17 00:00:00 2001 From: forwardxu Date: Sat, 16 May 2026 10:55:20 +0800 Subject: [PATCH] Fix inverted awaitTermination condition in LookupClient#close The shutdown logic in LookupClient#close() had the awaitTermination condition inverted - it called shutdownNow() when the thread pool had already terminated gracefully, and did nothing when it timed out. This is inconsistent with WriterClient#close() and all other shutdown patterns in the codebase which correctly negate awaitTermination() to trigger shutdownNow() on timeout. The bug could cause the lookup sender thread pool to not be forcefully terminated when graceful shutdown times out, potentially leading to resource leaks. --- .../main/java/org/apache/fluss/client/lookup/LookupClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fluss-client/src/main/java/org/apache/fluss/client/lookup/LookupClient.java b/fluss-client/src/main/java/org/apache/fluss/client/lookup/LookupClient.java index 7e27982941..47b15b1d53 100644 --- a/fluss-client/src/main/java/org/apache/fluss/client/lookup/LookupClient.java +++ b/fluss-client/src/main/java/org/apache/fluss/client/lookup/LookupClient.java @@ -122,7 +122,7 @@ public void close(Duration timeout) { if (lookupSenderThreadPool != null) { lookupSenderThreadPool.shutdown(); try { - if (lookupSenderThreadPool.awaitTermination( + if (!lookupSenderThreadPool.awaitTermination( timeout.toMillis(), TimeUnit.MILLISECONDS)) { lookupSenderThreadPool.shutdownNow();