apache/seatunnel · warning

Edge transport IO failure, will reconnect. batchId={}

Error message

Edge transport IO failure, will reconnect. batchId={}

What it means

EdgeTransportClient.sendUntilReceived retries a batch send in a loop. On IOException during a send it logs 'Edge transport IO failure, will reconnect', invalidates the current session, and loops to rebuild the connection and retry. Interrupted attempts break out and are rethrown as InterruptedException.

Source

Thrown at seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/socket/EdgeTransportClient.java:102

        synchronized (connectionLock) {
            IOException lastIo = null;
            InterruptedException lastInterrupted = null;
            for (int cycle = 0; cycle < config.getMaxReconnectCycles(); cycle++) {
                try {
                    ensureAuthenticatedSession();
                    lineTransport.sendBatchUntilReceived(
                            activeSocket.reader, activeSocket.writer, batchId, payload);
                    return;
                } catch (EdgeSocketCollectorRejectedException ex) {
                    invalidateSession();
                    throw ex;
                } catch (InterruptedException ex) {
                    Thread.currentThread().interrupt();
                    lastInterrupted = ex;
                    break;
                } catch (IOException ex) {
                    lastIo = ex;
                    LOG.warn("Edge transport IO failure, will reconnect. batchId={}", batchId, ex);
                    invalidateSession();
                }
            }
            if (lastInterrupted != null) {
                throw lastInterrupted;
            }
            if (lastIo != null) {
                throw lastIo;
            }
            throw new IOException(
                    "sendUntilReceived exhausted reconnect cycles for batchId=" + batchId);
        }
    }

    @Override
    public boolean probeReachable() throws IOException {
        synchronized (connectionLock) {
            try (Socket socket = socketFactory.connect(endpoint, config.getConnectTimeoutMs())) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. This is self-healing (session invalidated and retried); confirm subsequent logs show successful reconnect.
  2. Check receiver logs for resets around the same batchId.
  3. Enable TCP keepalive or reduce idle timeouts if load balancers drop quiet connections.
  4. Increase transport timeouts if large batches routinely exceed limits.

Example fix

// before
transport {
  idle-timeout-ms = 10000
}
// after: keep connections alive across LB idle windows
transport {
  idle-timeout-ms = 120000
}
Defensive patterns

Strategy: retry

Validate before calling

// Probe endpoint before sending large batches
if (!client.canReachEndpoint()) { client.ensureAuthenticatedSession(); }

Try / catch

try {
    client.send(batchId, payload);
} catch (IOException e) {
    // sendUntilReceived already invalidates the session and retries internally;
    // only handle exhaustion/interrupt at this layer
}

Prevention

When it happens

Trigger: send() or sendReconnectsWhenFirstSessionFails -> sendUntilReceived encounters IOException writing/reading on the socket (connection reset, broken pipe, read timeout) for the given batchId.

Common situations: Server restart or failover between sends, idle-connection timeouts on firewalls/load balancers killing the socket, or transient network blips in datacenter links.

Understand the failure class

Background: ECONNREFUSED and "connection refused" / "could not connect to server" errors: what they mean and how to fix them — this error's family across 44 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/69355916e0090fcb. Report an issue: GitHub.