apache/seatunnel · info
Failed to close during initialization cleanup.
Error message
Failed to close {} during initialization cleanup. What it means
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.
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.
Defensive patterns
Strategy: fallback
Try / catch
// The library already swallows the close IOException; treat the closeException log as noise and address the preceding initialization failure instead.
Prevention
- 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
When it happens
Trigger: initializeStreamLoad or cleanupInitializedStreamLoads closing an already-open stream load whose underlying HTTP connection/socket was already broken or timed out when close() is invoked.
Common situations: 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.
Related errors
- Close scanner from failed.
- CloseScanner result from
- Closing httpClient failed.
- Closing streamLoadHttpClient failed.
- COMMIT_FAILED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/980f6eab47474a2c.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-doris/src/main/java/org/apache/seatunnel/connectors/doris/sink/writer/DorisSinkWriter.java:414
}
private void cleanupInitializedStreamLoads(
DorisStreamLoad dataStreamLoad, DorisStreamLoad cleanupControlStreamLoad) {
closeStreamLoadQuietly(dataStreamLoad, "data stream load");
if (cleanupControlStreamLoad != dataStreamLoad) {
closeStreamLoadQuietly(cleanupControlStreamLoad, "control stream load");
}
scheduledExecutorService.shutdownNow();
}
private void closeStreamLoadQuietly(DorisStreamLoad streamLoad, String streamLoadName) {
if (streamLoad == null) {
return;
}
try {
streamLoad.close();
} catch (IOException closeException) {
log.warn(
"Failed to close {} during initialization cleanup.",
streamLoadName,
closeException);
}
}
private static final class InitializedStreamLoad {
private final String hostPort;
private final DorisStreamLoad streamLoad;
private InitializedStreamLoad(String hostPort, DorisStreamLoad streamLoad) {
this.hostPort = hostPort;
this.streamLoad = streamLoad;
}
}
}
View on GitHub (pinned to cf67b549a7)