{"record":{"id":"176438960602411d","repo":"apache/seatunnel","slug":"exceeded-maxbatchsendattempts-maxbatchsendattemp","errorCode":null,"errorMessage":"Exceeded maxBatchSendAttempts=${maxBatchSendAttempts} without RECEIVED for batch ${batchId}","messagePattern":"Exceeded maxBatchSendAttempts=(.+?) without RECEIVED for batch (.+?)","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":84,"sourceCode":"            }\n            if (EdgeSocketProtocol.RESP_DECRYPT_FAILED.equals(reply)) {\n                throw new IOException(\n                        \"Edge socket ingress decryption failed (DECRYPT_FAILED): verify \"\n                                + \"output.aes-secret-key-base64 matches EdgeSocket source \"\n                                + \"secret_key\");\n            }\n            throw new IOException(\n                    \"Unexpected batch response: \"\n                            + reply\n                            + \" (expected \"\n                            + EdgeSocketProtocol.RESP_RECEIVED\n                            + \", \"\n                            + EdgeSocketProtocol.RESP_RETRY\n                            + \", or \"\n                            + EdgeSocketProtocol.RESP_QUEUE_FULL_PREFIX\n                            + \"<ms>)\");\n        }\n        throw new IOException(\n                \"Exceeded maxBatchSendAttempts=\"\n                        + config.getMaxBatchSendAttempts()\n                        + \" without RECEIVED for batch \"\n                        + batchId);\n    }\n\n    private static void handleAuthResponse(String reply) throws IOException {\n        if (EdgeSocketProtocol.RESP_REJECTED.equals(reply)) {\n            throw new EdgeSocketCollectorRejectedException();\n        }\n        if (EdgeSocketProtocol.RESP_AUTH_FAILED.equals(reply)) {\n            throw new EdgeSocketCollectorRejectedException(\n                    \"Edge socket authentication rejected (AUTH_FAILED): check output token matches\"\n                            + \" EdgeSocket source secret_key\");\n        }\n        if (!EdgeSocketProtocol.RESP_ACK.equals(reply)) {\n            throw new IOException(\n                    \"Unexpected auth response: \"","sourceCodeStart":66,"sourceCodeEnd":102,"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#L66-L102","documentation":"sendBatchUntilReceived retries a batch only up to config.getMaxBatchSendAttempts() times (driven by RETRY replies, which increment the counter). If the attempt budget is exhausted without ever receiving RECEIVED, the loop exits and this IOException is thrown, meaning the batch was not acknowledged by the collector.","triggerScenarios":"Collector keeps answering RETRY (or QUEUE_FULL) for maxBatchSendAttempts consecutive attempts — persistent collector overload, backpressure, or slow ingestion — while never confirming the batch.","commonSituations":"Collector under heavy load with a small maxBatchSendAttempts; maxBatchSendAttempts set to a very low value in config; network latency causing long round trips combined with tight backoff caps; collector stuck processing a downstream sink.","solutions":["Increase maxBatchSendAttempts (and/or initialBackoffMs/maxBackoffMs) in EdgeTransportConfig to tolerate longer collector overload","Check collector-side logs/metrics for overload or downstream sink slowness and relieve the bottleneck","Persist/requeue the failed batch (WAL) and resend with the same batchId after the collector recovers","Verify network latency between agent and collector is within expected bounds"],"exampleFix":"// before\nconfig.setMaxBatchSendAttempts(3);\n// after\nconfig.setMaxBatchSendAttempts(20);\nconfig.setMaxBackoffMs(30_000);","handlingStrategy":"retry","validationCode":"// pre-check config\nif (config.getMaxBatchSendAttempts() < 5) log.warn(\"maxBatchSendAttempts too low for unstable links\");","typeGuard":null,"tryCatchPattern":"try { client.send(batchId, payload); } catch (IOException e) { if (e.getMessage().contains(\"Exceeded maxBatchSendAttempts\")) { wal.requeue(batchId, payload); } }","preventionTips":["Size maxBatchSendAttempts for worst-case collector load","Monitor collector queue depth and tune QUEUE_FULL backoffs","Keep the WAL so unacknowledged batches can be replayed","Alert on collector backlog before clients exhaust attempts"],"tags":["retry","timeout","backpressure","socket"],"backgroundTag":"request-timeout","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"}