{"record":{"id":"84a0e4ae890ec77a","repo":"apache/seatunnel","slug":"kudu-client-executor-did-not-terminate-gracefully","errorCode":null,"errorMessage":"Kudu client executor did not terminate gracefully, forcing shutdown.","messagePattern":"Kudu client executor did not terminate gracefully, forcing shutdown\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/kuduclient/KuduClientResource.java","lineNumber":70,"sourceCode":"\n    @Override\n    public void close() throws KuduException {\n        try {\n            kuduClient.close();\n        } finally {\n            awaitExecutorTermination();\n        }\n    }\n\n    private void awaitExecutorTermination() {\n        executorService.shutdown();\n        try {\n            if (executorService.awaitTermination(\n                    GRACEFUL_SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {\n                return;\n            }\n\n            log.warn(\"Kudu client executor did not terminate gracefully, forcing shutdown.\");\n            executorService.shutdownNow();\n            if (!executorService.awaitTermination(\n                    FORCED_SHUTDOWN_TIMEOUT_SECONDS, TimeUnit.SECONDS)) {\n                log.warn(\"Kudu client executor did not terminate after forced shutdown.\");\n            }\n        } catch (InterruptedException e) {\n            executorService.shutdownNow();\n            Thread.currentThread().interrupt();\n            log.warn(\"Interrupted while waiting for Kudu client executor to terminate.\", e);\n        }\n    }\n}\n","sourceCodeStart":52,"sourceCodeEnd":83,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-kudu/src/main/java/org/apache/seatunnel/connectors/seatunnel/kudu/kuduclient/KuduClientResource.java#L52-L83","documentation":"WARN logged by KuduClientResource.awaitExecutorTermination during close when the client's executor does not finish within the graceful shutdown timeout; shutdownNow() is invoked to force termination before checking again.","triggerScenarios":"close() calls awaitExecutorTermination; executorService.awaitTermination(GRACEFUL_SHUTDOWN_TIMEOUT_SECONDS) returns false because in-flight Kudu RPC/callback tasks are still running or blocked.","commonSituations":"Slow Kudu servers keeping RPCs pending at shutdown; jobs stopped while scans are mid-flight; blocked executor threads (network stalls, DNS); too-short graceful timeout for large result-set processing.","solutions":["Investigate why Kudu operations were slow at shutdown (server load, network)","Check the following 'did not terminate after forced shutdown' warnings for stubborn threads","Increase GRACEFUL_SHUTDOWN_TIMEOUT_SECONDS if legitimate work needs more time","Ensure sources/sinks release scanners and sessions promptly on close"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Confirm Kudu cluster responsiveness before task close/shutdown\nclient.listTabletServers(); // slow response predicts slow executor drain","typeGuard":null,"tryCatchPattern":"try {\n    if (!executor.awaitTermination(GRACE_SECONDS, TimeUnit.SECONDS)) {\n        executor.shutdownNow();\n        if (!executor.awaitTermination(FORCED_SECONDS, TimeUnit.SECONDS)) {\n            LOG.warn(\"Executor did not terminate after forced shutdown\");\n        }\n    }\n} catch (InterruptedException ie) {\n    executor.shutdownNow();\n    Thread.currentThread().interrupt();\n}","preventionTips":["Close Kudu scanners and sessions promptly in close() paths","Set graceful shutdown timeouts proportional to expected RPC latency","Monitor Kudu server health to avoid shutdown-time stalls"],"tags":["kudu","shutdown","executor"],"backgroundTag":"executor-shutdown-timeout","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}