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

  1. Inspect the logged closeException; it is secondary to the real initialization failure shown earlier in the log.
  2. Check network stability and Doris FE/BE availability between the worker and cluster.
  3. Tune HTTP connection timeouts/retries so connections are not abandoned mid-request.
  4. 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

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


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)