{"record":{"id":"b466dfaf545c0c82","repo":"apache/seatunnel","slug":"failed-to-clear-easysearch-scrollid","errorCode":null,"errorMessage":"Failed to clear Easysearch scrollId: ","messagePattern":"Failed to clear Easysearch scrollId: ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/source/EasysearchSourceReader.java","lineNumber":101,"sourceCode":"                                    sourceIndexInfo.getQuery(),\n                                    sourceIndexInfo.getScrollTime(),\n                                    sourceIndexInfo.getScrollSize());\n                    scrollId = scrollResult.getScrollId();\n                    outputFromScrollResult(scrollResult, sourceIndexInfo.getSource(), output);\n                    while (scrollResult.getDocs() != null && !scrollResult.getDocs().isEmpty()) {\n                        scrollResult =\n                                ezsClient.searchWithScrollId(\n                                        scrollResult.getScrollId(),\n                                        sourceIndexInfo.getScrollTime());\n                        scrollId = scrollResult.getScrollId();\n                        outputFromScrollResult(scrollResult, sourceIndexInfo.getSource(), output);\n                    }\n                } finally {\n                    if (scrollId != null && !scrollId.isEmpty()) {\n                        try {\n                            ezsClient.clearScroll(scrollId);\n                        } catch (Exception e) {\n                            log.warn(\"Failed to clear Easysearch scrollId: \" + scrollId, e);\n                        }\n                    }\n                }\n            } else if (noMoreSplit) {\n                // signal to the source that we have reached the end of the data.\n                log.info(\"Closed the bounded Easysearch source\");\n                context.signalNoMoreElement();\n            } else {\n                Thread.sleep(pollNextWaitTime);\n            }\n        }\n    }\n\n    private void outputFromScrollResult(\n            ScrollResult scrollResult, List<String> source, Collector<SeaTunnelRow> output) {\n        for (Map<String, Object> doc : scrollResult.getDocs()) {\n            SeaTunnelRow seaTunnelRow = deserializer.deserialize(new EasysearchRecord(doc, source));\n            output.collect(seaTunnelRow);","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/source/EasysearchSourceReader.java#L83-L119","documentation":"A WARN logged by EasysearchSourceReader.pollNext in its finally block when client.clearScroll(scrollId) throws after finishing a scroll batch. It is a best-effort cleanup failure; the read continues and the scroll context simply expires via its TTL.","triggerScenarios":"Any exception propagating from clearScroll during pollNext's finally — typically the IOException cases of EasysearchClient.clearScroll (connection reset, node down) or unexpected client exceptions.","commonSituations":"Cluster node failure between scroll fetches; flaky network from SeaTunnel workers; short-lived scroll contexts that expire exactly during cleanup.","solutions":["Ignore if sporadic — the scroll expires via its TTL; no data loss occurs since the batch was already consumed.","Check cluster health and network stability if it recurs frequently.","Increase scroll keep-alive so the context survives until cleanup.","Confirm this is only a warning and the job completes; escalate only if coupled with read errors."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    ezsClient.clearScroll(scrollId);\n} catch (Exception e) {\n    log.warn(\"scroll cleanup failed, TTL will expire it\", e); // already in the library\n}","preventionTips":["Accept TTL-based cleanup for sporadic failures","Stabilize network paths to the Easysearch cluster","Only escalate if paired with read failures"],"tags":["easysearch","scroll","source-reader","cleanup","network"],"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"}