{"record":{"id":"4c9f9d59c330c93a","repo":"apache/seatunnel","slug":"failed-to-close-fluss-admin-for","errorCode":null,"errorMessage":"Failed to close Fluss admin for {}","messagePattern":"Failed to close Fluss admin 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":166,"sourceCode":"    private static com.alibaba.fluss.metadata.TablePath toFlussTablePath(TablePath tablePath) {\n        return com.alibaba.fluss.metadata.TablePath.of(\n                tablePath.getDatabaseName(), tablePath.getTableName());\n    }\n\n    @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":148,"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#L148-L176","documentation":"FlussAdminClient.close() closes the Fluss Admin client and its underlying connection inside a TemporaryClassLoaderContext so classes resolve against the connector's classloader. If admin.close() throws while releasing resources, the exception is swallowed and only logged as this warning with the client's description, so shutdown proceeds to close the connection. Resources may be left unclosed on the Fluss server/broker side until they time out.","triggerScenarios":"Calling close() on FlussAdminClient when the Fluss Admin's close() throws — e.g. broker unreachable during shutdown, RPC timeout, or classloader-related linkage errors that occur despite the TemporaryClassLoaderContext.","commonSituations":"Job cancellation or task shutdown while the Fluss cluster is briefly unavailable; network partitions at teardown; Fluss client/server version skew causing close-time protocol errors.","solutions":["Check the logged stack trace (the warning carries the exception) to identify why admin.close() failed and address that root cause.","Verify the Fluss brokers are reachable and healthy at shutdown time; transient unavailability usually means resources are cleaned up server-side by timeout.","Ensure Fluss client dependency versions match the Fluss server version to avoid close-time protocol mismatches.","If the warning is noisy but harmless, it can be tolerated — close() continues to release the connection regardless."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before shutdown, confirm the admin is usable so close() is likely clean\nadmin.getTableDescriptor(tablePath); // throws if the client/broker is already broken","typeGuard":null,"tryCatchPattern":"try {\n    adminClient.close();\n} catch (Exception e) {\n    // close() swallows admin.close()/connection.close() errors internally;\n    // reaching here means an unexpected failure outside resource release\n    log.error(\"Unexpected failure closing FlussAdminClient\", e);\n}","preventionTips":["Ensure Fluss brokers are reachable during job cancellation/teardown windows.","Keep Fluss client and server versions aligned to avoid close-time protocol errors.","Close the admin client exactly once in the reader lifecycle to avoid double-close issues.","Treat the warning as informational: server-side resources are reclaimed by timeout if close RPCs fail."],"tags":["fluss","resource-cleanup","shutdown","admin-client"],"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"}