{"record":{"id":"2c6209dbc185010a","repo":"apache/seatunnel","slug":"iotdbconnectorerrorcode-close-session-failed-2c6209","errorCode":"IotdbConnectorErrorCode.CLOSE_SESSION_FAILED","errorMessage":"Close IoTDB session failed","messagePattern":"Close IoTDB session failed","errorType":"error_code","errorClass":"IotdbConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-iotdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdb/source/IoTDBSourceReader.java","lineNumber":94,"sourceCode":"        this.context = readerContext;\n        this.deserializer = new DefaultSeaTunnelRowDeserializer(rowType);\n    }\n\n    @Override\n    public void open() throws IoTDBConnectionException {\n        session = buildSession(conf);\n        session.open();\n    }\n\n    @Override\n    public void close() throws IOException {\n        // nothing to do\n        try {\n            if (session != null) {\n                session.close();\n            }\n        } catch (IoTDBConnectionException e) {\n            throw new IotdbConnectorException(\n                    IotdbConnectorErrorCode.CLOSE_SESSION_FAILED, \"Close IoTDB session failed\", e);\n        }\n    }\n\n    @Override\n    public void pollNext(Collector<SeaTunnelRow> output) throws Exception {\n        while (!pendingSplits.isEmpty()) {\n            synchronized (output.getCheckpointLock()) {\n                IoTDBSourceSplit split = pendingSplits.poll();\n                read(split, output);\n            }\n        }\n\n        if (Boundedness.BOUNDED.equals(context.getBoundedness())\n                && noMoreSplitsAssignment\n                && pendingSplits.isEmpty()) {\n            // signal to the source that we have reached the end of the data.\n            log.info(\"Closed the bounded iotdb source\");","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-iotdb/src/main/java/org/apache/seatunnel/connectors/seatunnel/iotdb/source/IoTDBSourceReader.java#L76-L112","documentation":"IoTDBSourceReader.close() failed to close the IoTDB session cleanly, throwing IotdbConnectorException(CLOSE_SESSION_FAILED). The reader is shutting down (task stop/close) and the session.close() call raised IoTDBConnectionException, usually because the connection to the server is already gone.","triggerScenarios":"session.close() throws IoTDBConnectionException during reader close — server unreachable, connection already closed/timed out, or network interrupted at shutdown.","commonSituations":"IoTDB restarted or killed before the SeaTunnel task closed; network partition during job teardown; session idle timeout on the server side; closing after a prior connection failure.","solutions":["Verify IoTDB is reachable; if the server is already down this error is usually harmless at teardown — inspect logs for other failures.","Ensure the reader doesn't outlive the IoTDB session's idle timeout; tune server-side session timeouts.","Check for double-close of the reader/session in custom code.","If persistent, review IoTDB client/driver version compatibility."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { reader.close(); } catch (IotdbConnectorException e) { log.warn(\"IoTDB session close failed during teardown; ignoring\", e); }","preventionTips":["Accept close-time connection errors as usually benign; check for earlier real failures","Tune IoTDB session idle timeouts to exceed job duration","Avoid double-closing readers/sessions"],"tags":["iotdb","source","session-close","shutdown"],"backgroundTag":"connection-refused","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}