{"record":{"id":"980f6eab47474a2c","repo":"apache/seatunnel","slug":"failed-to-close-during-initialization-cleanup","errorCode":null,"errorMessage":"Failed to close {} during initialization cleanup.","messagePattern":"Failed to close (.+?) during initialization cleanup\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisSinkWriter.java","lineNumber":414,"sourceCode":"    }\n\n    private void cleanupInitializedStreamLoads(\n            DorisStreamLoad dataStreamLoad, DorisStreamLoad cleanupControlStreamLoad) {\n        closeStreamLoadQuietly(dataStreamLoad, \"data stream load\");\n        if (cleanupControlStreamLoad != dataStreamLoad) {\n            closeStreamLoadQuietly(cleanupControlStreamLoad, \"control stream load\");\n        }\n        scheduledExecutorService.shutdownNow();\n    }\n\n    private void closeStreamLoadQuietly(DorisStreamLoad streamLoad, String streamLoadName) {\n        if (streamLoad == null) {\n            return;\n        }\n        try {\n            streamLoad.close();\n        } catch (IOException closeException) {\n            log.warn(\n                    \"Failed to close {} during initialization cleanup.\",\n                    streamLoadName,\n                    closeException);\n        }\n    }\n\n    private static final class InitializedStreamLoad {\n        private final String hostPort;\n        private final DorisStreamLoad streamLoad;\n\n        private InitializedStreamLoad(String hostPort, DorisStreamLoad streamLoad) {\n            this.hostPort = hostPort;\n            this.streamLoad = streamLoad;\n        }\n    }\n}\n","sourceCodeStart":396,"sourceCodeEnd":431,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisSinkWriter.java#L396-L431","documentation":"During stream-load channel initialization, DorisSinkWriter.closeStreamLoadQuietly closes a previously opened DorisStreamLoad handle while rolling back a failed initialization. If close() throws an IOException, it is logged as this warning so the cleanup continues without masking the original initialization failure.","triggerScenarios":"initializeStreamLoad or cleanupInitializedStreamLoads closing an already-open stream load whose underlying HTTP connection/socket was already broken or timed out when close() is invoked.","commonSituations":"Network interruptions between worker and Doris FE/BE; Doris node restart causing stale HTTP connections; pre-opened loads created before a redirect/retry loop left connections half-open.","solutions":["Inspect the logged closeException; it is secondary to the real initialization failure shown earlier in the log.","Check network stability and Doris FE/BE availability between the worker and cluster.","Tune HTTP connection timeouts/retries so connections are not abandoned mid-request.","If it recurs, upgrade the connector — connection cleanup handling has been improved in later SeaTunnel releases."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"// The library already swallows the close IOException; treat the closeException log as noise and address the preceding initialization failure instead.","preventionTips":["Keep worker-to-Doris network stable (avoid aggressive idle connection timeouts)","Upgrade connectors where stream-load cleanup is hardened","Monitor for repeated close warnings as a symptom of underlying network issues"],"tags":["io","stream-load","cleanup","doris"],"backgroundTag":"broken-pipe","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"}