apache/druid · error · RuntimeException
Failed to load next batch of results
Error message
Failed to load next batch of results
What it means
The CombiningYielderAdapter-style nextBatch() in ParallelMergeCombiningSequence blocks via ForkJoinPool.managedBlock() waiting for the next ResultBatch from workers. An InterruptedException is wrapped in RuntimeException('Failed to load next batch of results').
Source
Thrown at processing/src/main/java/org/apache/druid/java/util/common/guava/ParallelMergeCombiningSequence.java:1024
BatchedResultsCursor(Ordering<E> ordering)
{
this.ordering = ordering;
}
public abstract void initialize();
public abstract void advance();
public abstract boolean isDone();
void nextBatch()
{
try {
ForkJoinPool.managedBlock(this);
}
catch (InterruptedException e) {
throw new RuntimeException("Failed to load next batch of results", e);
}
}
@Override
public void close() throws IOException
{
// nothing to close for blocking queue, but yielders will need to clean up or they will leak resources
}
public E get()
{
return resultBatch.get();
}
@Override
public int compareTo(BatchedResultsCursor<E> o)
{
return ordering.compare(get(), o.get());View on GitHub (pinned to 9b90983fd2)
Solutions
- Confirm whether the interruption was a deliberate cancel (check query cancellation logs/scheduler)
- Retry the query if cancellation was unintended; adjust timeouts otherwise
- Close the Yielder promptly on failure to release underlying batch yielders
Example fix
// before
while (!yielder.isDone()) { yielder = yielder.next(init); } // interrupted mid-stream
// after
try {
while (!yielder.isDone()) { yielder = yielder.next(init); }
} catch (RuntimeException e) {
if (e.getCause() instanceof InterruptedException) { /* cancelled */ }
yielder.close();
throw e;
} Defensive patterns
Strategy: try-catch
Try / catch
try { yielder = yielder.next(init); } catch (RuntimeException e) {
if (e.getCause() instanceof InterruptedException) { Thread.currentThread().interrupt(); yielder.close(); return; }
throw e;
} Prevention
- Always close yielders in finally/try-with-resources after interruptions
- Avoid long consumer stalls that widen the interruption window
- Monitor cancellation rates to distinguish ops issues from expected cancels
When it happens
Trigger: Thread interruption while advancing to the next result batch during iteration of a parallel merge combining sequence (after the first batch loaded successfully).
Common situations: Mid-stream query cancellation or timeout; broker or task shutdown while results are still streaming from parallel merge workers.
Understand the failure class
Background: Request timed out: what client-side request timeouts mean across libraries (Request timed out, TIMED_OUT, APITimeoutError) — this error's family across 39 libraries.
Related errors
- Failed to offer result to output queue
- Failed to load initial batch of results
- Exception while waiting to extract distributions.
- Transaction failure publishing segments for sequence [%s]
- Stream ingestion task unexpectedly attempted to overwrite se
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/966a747e754740c3.
Report an issue: GitHub.