{"record":{"id":"34cab773ec9496ab","repo":"apache/seatunnel","slug":"eof-from-edge-socket-ingress","errorCode":null,"errorMessage":"EOF from edge socket ingress","messagePattern":"EOF from edge socket ingress","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/socket/EdgeSocketLineTransport.java","lineNumber":125,"sourceCode":"                            + EdgeSocketProtocol.RESP_REJECTED\n                            + \")\");\n        }\n    }\n\n    private static long parseQueueFullBackoffMs(String reply) {\n        String suffix = reply.substring(EdgeSocketProtocol.RESP_QUEUE_FULL_PREFIX.length());\n        try {\n            long ms = Long.parseLong(suffix.trim());\n            return ms > 0 ? ms : EdgeSocketProtocol.DEFAULT_QUEUE_FULL_BACKOFF_MS;\n        } catch (NumberFormatException ex) {\n            return EdgeSocketProtocol.DEFAULT_QUEUE_FULL_BACKOFF_MS;\n        }\n    }\n\n    static String readLineNormalized(BufferedReader reader) throws IOException {\n        String line = reader.readLine();\n        if (line == null) {\n            throw new IOException(\"EOF from edge socket ingress\");\n        }\n        return stripTailCarriageReturn(line).trim();\n    }\n\n    static void writeLine(BufferedWriter writer, String value) throws IOException {\n        writer.write(value);\n        writer.newLine();\n        writer.flush();\n    }\n\n    private static String stripTailCarriageReturn(String value) {\n        if (value.endsWith(\"\\r\")) {\n            return value.substring(0, value.length() - 1);\n        }\n        return value;\n    }\n}\n","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/socket/EdgeSocketLineTransport.java#L107-L143","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// caller pattern\ntry {\n    transport.sendBatchUntilReceived(reader, writer, batchId, payload);\n} catch (IOException e) {\n    if (e.getMessage().contains(\"EOF from edge socket ingress\")) {\n        client.reconnect(); // then resend with same batchId\n    }\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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"],"tags":["network","eof","socket","connection-closed"],"backgroundTag":"connection-closed","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"}