{"record":{"id":"47a8b98df58d73c7","repo":"apache/seatunnel","slug":"closing-streamloadhttpclient-failed","errorCode":null,"errorMessage":"Closing streamLoadHttpClient failed.","messagePattern":"Closing streamLoadHttpClient failed\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisStreamLoad.java","lineNumber":368,"sourceCode":"        String loadResult = EntityUtils.toString(response.getEntity());\n        Map<String, String> res =\n                JsonUtils.parseObject(loadResult, new TypeReference<HashMap<String, String>>() {});\n        if (!LoadStatus.SUCCESS.equals(res.get(\"status\"))) {\n            if (ResponseUtil.isCommitted(res.get(\"msg\"))) {\n                throw new DorisConnectorException(\n                        DorisConnectorErrorCode.STREAM_LOAD_FAILED,\n                        \"try abort committed transaction, \" + \"do you recover from old savepoint?\");\n            }\n            log.warn(\"Fail to abort transaction. txnId: {}, error: {}\", txnID, res.get(\"msg\"));\n        }\n    }\n\n    public void close() throws IOException {\n        if (null != streamLoadHttpClient) {\n            try {\n                streamLoadHttpClient.close();\n            } catch (IOException e) {\n                throw new IOException(\"Closing streamLoadHttpClient failed.\", e);\n            }\n        }\n        if (null != httpClient) {\n            try {\n                httpClient.close();\n            } catch (IOException e) {\n                throw new IOException(\"Closing httpClient failed.\", e);\n            }\n        }\n        if (null != executorService) {\n            executorService.shutdownNow();\n        }\n    }\n}\n","sourceCodeStart":350,"sourceCodeEnd":383,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisStreamLoad.java#L350-L383","documentation":"DorisStreamLoad.close() wraps any IOException thrown while closing the dedicated stream-load HTTP client (CloseableHttpAsyncClient) and rethrows it with this message. It indicates resources of the stream load client could not be released cleanly.","triggerScenarios":"closeStreamLoadQuietly invokes DorisStreamLoad.close() while streamLoadHttpClient != null and its close() throws an IOException.","commonSituations":"Client still executing in-flight requests during task cancellation; interrupted I/O during job failover; underlying connection pool shutdown errors.","solutions":["Inspect the cause for the underlying close failure","Ensure in-flight stream loads are finished/aborted before closing the writer","Ignore if it occurs during abrupt task cancellation after the job state is recovered","Upgrade connector version where close is more defensive"],"exampleFix":"// before\n// close() propagates IOException\n// after\ntry {\n    streamLoad.close();\n} catch (IOException e) {\n    LOG.warn(\"DorisStreamLoad close failed\", e);\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { streamLoad.close(); } catch (IOException e) { LOG.warn(\"DorisStreamLoad close failed\", e); }","preventionTips":["Complete or abort stream loads before closing","Avoid closing during active request execution","Log-and-continue during failover teardown"],"tags":["doris","io","http-client","resource-cleanup"],"backgroundTag":"broken-pipe","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"}