apache/seatunnel · error · IOException
EOF from edge socket ingress
Error message
EOF from edge socket ingress
What it means
readLineNormalized wraps BufferedReader.readLine and throws this IOException when it returns null, meaning the socket reached EOF before a reply line arrived. Every reply read (auth ACK, batch RECEIVED/RETRY/QUEUE_FULL) goes through it, so this error means the collector closed the connection (or it broke) instead of answering.
Source
Thrown at seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/socket/EdgeSocketLineTransport.java:125
+ EdgeSocketProtocol.RESP_REJECTED
+ ")");
}
}
private static long parseQueueFullBackoffMs(String reply) {
String suffix = reply.substring(EdgeSocketProtocol.RESP_QUEUE_FULL_PREFIX.length());
try {
long ms = Long.parseLong(suffix.trim());
return ms > 0 ? ms : EdgeSocketProtocol.DEFAULT_QUEUE_FULL_BACKOFF_MS;
} catch (NumberFormatException ex) {
return EdgeSocketProtocol.DEFAULT_QUEUE_FULL_BACKOFF_MS;
}
}
static String readLineNormalized(BufferedReader reader) throws IOException {
String line = reader.readLine();
if (line == null) {
throw new IOException("EOF from edge socket ingress");
}
return stripTailCarriageReturn(line).trim();
}
static void writeLine(BufferedWriter writer, String value) throws IOException {
writer.write(value);
writer.newLine();
writer.flush();
}
private static String stripTailCarriageReturn(String value) {
if (value.endsWith("\r")) {
return value.substring(0, value.length() - 1);
}
return value;
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Treat this as a transient connection loss: reconnect and resend the batch with the same batchId (EdgeTransportClient already retries across reconnect cycles)
- Enable TCP keepalive or application-level pings to detect/avoid idle disconnects
- Check collector logs around the failure time for crashes, OOM, or explicit closes
- Increase LB/firewall idle timeouts or route the traffic without an idle-dropping middlebox
Example fix
// caller pattern
try {
transport.sendBatchUntilReceived(reader, writer, batchId, payload);
} catch (IOException e) {
if (e.getMessage().contains("EOF from edge socket ingress")) {
client.reconnect(); // then resend with same batchId
}
} Defensive patterns
Strategy: retry
Try / catch
try { client.send(batchId, payload); } catch (IOException e) { if (e.getMessage().contains("EOF from edge socket ingress")) { client.reconnect(); client.send(batchId, payload); return; } throw e; } Prevention
- Enable TCP keepalive on long-lived connections
- Raise LB/firewall idle timeouts above the max send interval
- Resend with the same batchId so the collector can deduplicate
- Monitor collector restarts/OOM events that drop connections
When it happens
Trigger: The collector (or an intermediary) closes/crashes the TCP connection while the agent is blocked waiting for a reply to the AUTH line or a BATCH line; idle connection killed by a firewall/LB; collector OOM-killed mid-request.
Common situations: Collector restart while a batch is in flight; LB idle-timeout dropping long-lived socket connections; keepalive disabled and the connection silently dropped; network device (NAT/firewall) terminating the session.
Related errors
- SOURCE_REOPEN_EXHAUSTED
- Edge socket receiver loop exception, retrying
- Failed to close edge socket server socket on {}:{}
- Edge transport IO failure, will reconnect. batchId={}
- Failed to fetch metadata from Gravitino for metadata: %s
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/34cab773ec9496ab.
Report an issue: GitHub.