{"record":{"id":"04ef24e3a73fe81f","repo":"apache/seatunnel","slug":"edge-socket-receiver-loop-exception-retrying","errorCode":null,"errorMessage":"Edge socket receiver loop exception, retrying","messagePattern":"Edge socket receiver loop exception, retrying","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/source/EdgeSocketIngressServer.java","lineNumber":183,"sourceCode":"                if (shouldExitOnException(e)) {\n                    return;\n                }\n            }\n        }\n    }\n\n    private boolean shouldExitOnException(Exception e) {\n        if (!isReceiverActive()) {\n            return true;\n        }\n        if (e instanceof EdgeSocketConnectorException) {\n            EdgeSocketConnectorException ece = (EdgeSocketConnectorException) e;\n            if (ece.getSeaTunnelErrorCode()\n                    == EdgeSocketConnectorErrorCode.SOURCE_REOPEN_EXHAUSTED) {\n                throw ece;\n            }\n        }\n        log.warn(\"Edge socket receiver loop exception, retrying\", e);\n        return isInterruptedDuringRetryWait();\n    }\n\n    private void serveOneCollector() throws IOException {\n        ServerSocket ss = serverSocket;\n        if (ss == null || ss.isClosed()) {\n            return;\n        }\n\n        Socket raw = ss.accept();\n        raw.setSoTimeout(config.getAcceptTimeoutMs());\n        try (IngressChannel channel = new BlockingIngressChannel(raw)) {\n            log.info(\"Accepted edge collector connection from {}\", channel.remoteAddress());\n            if (hasActiveCollector) {\n                log.warn(\n                        \"Rejected edge collector from {}: another collector is already connected\",\n                        channel.remoteAddress());\n                channel.writeLine(EdgeSocketResponseCode.REJECTED.getCode());","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/source/EdgeSocketIngressServer.java#L165-L201","documentation":"EdgeSocketIngressServer.shouldExitOnException logs this warning when the receiver loop hit an exception that is NOT terminal: if the exception is an EdgeSocketConnectorException with SOURCE_REOPEN_EXHAUSTED it is rethrown; otherwise the loop logs 'retrying' and returns whether it was interrupted during the retry wait. The source keeps trying to receive data instead of failing the task.","triggerScenarios":"receiveLoop caught an arbitrary exception (IO error, socket reset, decoder failure) that is not the reopen-exhausted marker; logged right before a retry back-off wait.","commonSituations":"Edge device dropping the TCP connection mid-send; network blips between the collector and the ingress server; malformed frames from a misbehaving sender; server socket temporarily unavailable during redeploy.","solutions":["Check the chained cause in the log for the underlying IO/protocol error","Verify the edge device/sender is connected and sending well-formed frames","Tune the connector's retry/reopen limits so transient blips don't exhaust reopen attempts","Inspect network stability (timeouts, MTU, firewall) between sender and receiver"],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// Before starting the source, verify the ingress port is bindable and reachable\ntry (ServerSocket s = new ServerSocket(port)) { /* port free */ }","typeGuard":null,"tryCatchPattern":"try { server.receiveLoop(); } catch (EdgeSocketConnectorException e) { if (e.getSeaTunnelErrorCode() == EdgeSocketConnectorErrorCode.SOURCE_REOPEN_EXHAUSTED) { /* fail job / restart from checkpoint */ } else { retryWithBackoff(); } }","preventionTips":["Configure generous retry/reopen limits with exponential back-off","Monitor edge-device connectivity and sender frame validity","Alert on repeated 'receiver loop exception' warnings before reopen exhaustion"],"tags":["socket","retry","network","source"],"backgroundTag":"network-request-failed","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"}