{"record":{"id":"82c5f1e8a4019ca8","repo":"apache/seatunnel","slug":"failed-to-close-fluss-connection-for","errorCode":null,"errorMessage":"Failed to close Fluss connection for {}","messagePattern":"Failed to close Fluss connection for (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-fluss/src/main/java/org/apache/seatunnel/connectors/seatunnel/fluss/source/FlussAdminClient.java","lineNumber":171,"sourceCode":"    @Override\n    public void close() {\n        // Best-effort: this client only backs short-lived schema/offset discovery, so a failure to\n        // release it must not fail a job (or a discovery) whose data was already fetched. Both the\n        // admin and the connection are always attempted; failures are logged, not thrown.\n        // Pin the connector classloader (see createConnection): teardown may run on a framework\n        // thread whose context classloader is not the connector's, and Fluss can lazily load\n        // classes while closing.\n        try (TemporaryClassLoaderContext ignored =\n                TemporaryClassLoaderContext.of(FlussAdminClient.class.getClassLoader())) {\n            try {\n                admin.close();\n            } catch (Exception e) {\n                log.warn(\"Failed to close Fluss admin for {}\", description, e);\n            }\n            try {\n                connection.close();\n            } catch (Exception e) {\n                log.warn(\"Failed to close Fluss connection for {}\", description, e);\n            }\n        }\n    }\n}\n","sourceCodeStart":153,"sourceCodeEnd":176,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-fluss/src/main/java/org/apache/seatunnel/connectors/seatunnel/fluss/source/FlussAdminClient.java#L153-L176","documentation":"FlussAdminClient.close() closes the underlying Fluss Connection after closing the Admin, both inside a TemporaryClassLoaderContext to ensure correct classloading. If connection.close() throws, the exception is swallowed and logged as this warning with the client's description; close() still completes without propagating an error to the caller.","triggerScenarios":"Calling close() on FlussAdminClient when the Fluss Connection's close() throws — e.g. connection already broken, network failure to the Fluss server during teardown, or a timeout closing remote resources.","commonSituations":"Shutdown after a network outage; killing tasks while a connection is mid-RPC; duplicate close() invocations on an already-closed connection; Fluss server restarting at the same time the job is cancelled.","solutions":["Inspect the logged stack trace attached to this warning for the underlying cause (unreachable server, timeout, already-closed).","Confirm Fluss server reachability and that the job teardown happens after the cluster is stable.","Avoid closing the client twice; ensure the source reader lifecycle closes the client exactly once.","Typically safe to ignore — the warning only means server-side resources will be reclaimed by timeout."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before shutdown, drop stale connections so close() is likely clean\nif (!connection.is reachableCheckEnabled()) pingBroker(); // replace with your health probe","typeGuard":null,"tryCatchPattern":"try {\n    adminClient.close();\n} catch (Exception e) {\n    // connection-close errors are logged internally and not rethrown;\n    // handle only unexpected outer failures here\n    log.error(\"Unexpected failure closing FlussAdminClient\", e);\n}","preventionTips":["Avoid cancelling jobs during known Fluss maintenance windows or restarts.","Verify network/firewall stability between workers and Fluss servers.","Close each connection once; guard lifecycle code against duplicate close() calls.","Ignore benign already-closed warnings; investigate only if they repeat with real I/O errors."],"tags":["fluss","resource-cleanup","connection","shutdown"],"backgroundTag":"resource-cleanup-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}