{"record":{"id":"82b4fb8d4cb1df73","repo":"apache/seatunnel","slug":"senduntilreceived-exhausted-reconnect-cycles-for-b","errorCode":null,"errorMessage":"sendUntilReceived exhausted reconnect cycles for batchId=${batchId}","messagePattern":"sendUntilReceived exhausted reconnect cycles for batchId=(.+?)","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/EdgeTransportClient.java","lineNumber":112,"sourceCode":"                    invalidateSession();\n                    throw ex;\n                } catch (InterruptedException ex) {\n                    Thread.currentThread().interrupt();\n                    lastInterrupted = ex;\n                    break;\n                } catch (IOException ex) {\n                    lastIo = ex;\n                    LOG.warn(\"Edge transport IO failure, will reconnect. batchId={}\", batchId, ex);\n                    invalidateSession();\n                }\n            }\n            if (lastInterrupted != null) {\n                throw lastInterrupted;\n            }\n            if (lastIo != null) {\n                throw lastIo;\n            }\n            throw new IOException(\n                    \"sendUntilReceived exhausted reconnect cycles for batchId=\" + batchId);\n        }\n    }\n\n    @Override\n    public boolean probeReachable() throws IOException {\n        synchronized (connectionLock) {\n            try (Socket socket = socketFactory.connect(endpoint, config.getConnectTimeoutMs())) {\n                return socket.isConnected();\n            } catch (IOException ex) {\n                LOG.debug(\"Probe failed for {}\", endpoint, ex);\n                return false;\n            }\n        }\n    }\n\n    @Override\n    public void close() {","sourceCodeStart":94,"sourceCodeEnd":130,"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/EdgeTransportClient.java#L94-L130","documentation":"EdgeTransportClient.sendUntilReceived retries a batch across full reconnect cycles: each cycle opens a session, authenticates, and tries sendBatchUntilReceived. If all reconnect cycles fail, the last recorded InterruptedException/IOException is rethrown if present; only when no underlying exception was captured does it throw this fallback IOException, meaning the batch could not be confirmed after every reconnect attempt.","triggerScenarios":"Every reconnect cycle fails in a way that stores neither lastIo nor lastInterrupted (e.g. open aborted via IllegalStateException/EdgeSocketCollectorRejectedException repeatedly), exhausting the cycle budget for the given batchId.","commonSituations":"Collector persistently rejecting auth so each cycle fails before an IOException is recorded; sustained collector outage combined with a low reconnect-cycle limit; misconfigured host/port making every cycle abort non-IO.","solutions":["Check earlier log lines for the per-cycle root cause (auth rejection, EOF, unexpected response) and fix that root cause first","Increase the reconnect-cycle limit / backoff in EdgeTransportConfig for longer outages","Persist the unacknowledged batchId (WAL) and replay it after the collector recovers","Verify the collector address and credentials, since non-IO failures (rejection, illegal state) are the usual silent causes"],"exampleFix":"// before\nclient.send(batchId, payload); // throws after all cycles\n// after\ntry {\n    client.send(batchId, payload);\n} catch (IOException e) {\n    wal.persist(batchId, payload); // replay later with same batchId\n    throw e;\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { client.send(batchId, payload); } catch (IOException e) { if (e.getMessage().contains(\"exhausted reconnect cycles\")) { wal.replayLater(batchId, payload); } throw e; }","preventionTips":["Read the per-cycle root cause in logs; fix auth/config issues that fail every cycle non-IO","Set reconnect-cycle limits and backoffs to cover realistic outage lengths","Keep a WAL to replay batches that never received RECEIVED","Alert on this error — it means a batch is unacknowledged and needs replay"],"tags":["retry","reconnect","socket","unacknowledged-batch"],"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"}