apache/seatunnel · warning

Failed to clear Easysearch scrollId:

Error message

Failed to clear Easysearch scrollId: 

What it means

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.

Source

Thrown at seatunnel-connectors-v2/connector-easysearch/src/main/java/org/apache/seatunnel/connectors/seatunnel/easysearch/source/EasysearchSourceReader.java:101

                                    sourceIndexInfo.getQuery(),
                                    sourceIndexInfo.getScrollTime(),
                                    sourceIndexInfo.getScrollSize());
                    scrollId = scrollResult.getScrollId();
                    outputFromScrollResult(scrollResult, sourceIndexInfo.getSource(), output);
                    while (scrollResult.getDocs() != null && !scrollResult.getDocs().isEmpty()) {
                        scrollResult =
                                ezsClient.searchWithScrollId(
                                        scrollResult.getScrollId(),
                                        sourceIndexInfo.getScrollTime());
                        scrollId = scrollResult.getScrollId();
                        outputFromScrollResult(scrollResult, sourceIndexInfo.getSource(), output);
                    }
                } finally {
                    if (scrollId != null && !scrollId.isEmpty()) {
                        try {
                            ezsClient.clearScroll(scrollId);
                        } catch (Exception e) {
                            log.warn("Failed to clear Easysearch scrollId: " + scrollId, e);
                        }
                    }
                }
            } else if (noMoreSplit) {
                // signal to the source that we have reached the end of the data.
                log.info("Closed the bounded Easysearch source");
                context.signalNoMoreElement();
            } else {
                Thread.sleep(pollNextWaitTime);
            }
        }
    }

    private void outputFromScrollResult(
            ScrollResult scrollResult, List<String> source, Collector<SeaTunnelRow> output) {
        for (Map<String, Object> doc : scrollResult.getDocs()) {
            SeaTunnelRow seaTunnelRow = deserializer.deserialize(new EasysearchRecord(doc, source));
            output.collect(seaTunnelRow);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Ignore if sporadic — the scroll expires via its TTL; no data loss occurs since the batch was already consumed.
  2. Check cluster health and network stability if it recurs frequently.
  3. Increase scroll keep-alive so the context survives until cleanup.
  4. Confirm this is only a warning and the job completes; escalate only if coupled with read errors.
Defensive patterns

Strategy: fallback

Try / catch

try {
    ezsClient.clearScroll(scrollId);
} catch (Exception e) {
    log.warn("scroll cleanup failed, TTL will expire it", e); // already in the library
}

Prevention

When it happens

Trigger: Any exception propagating from clearScroll during pollNext's finally — typically the IOException cases of EasysearchClient.clearScroll (connection reset, node down) or unexpected client exceptions.

Common situations: Cluster node failure between scroll fetches; flaky network from SeaTunnel workers; short-lived scroll contexts that expire exactly during cleanup.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/b466dfaf545c0c82. Report an issue: GitHub.