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
- 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.
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
- Accept TTL-based cleanup for sporadic failures
- Stabilize network paths to the Easysearch cluster
- Only escalate if paired with read failures
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
- Error clearing scrollId
- DELETE {} response null when clearing scrollId {}
- Failed to clear scrollId {}, status code={}
- Failed to clear scroll ID: ${scrollId}
- Failed to read data from part %s, shard: %s, splitId: %s, me
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/b466dfaf545c0c82.
Report an issue: GitHub.