apache/druid · error · IllegalStateException
Exception while waiting to extract distributions.
Error message
Exception while waiting to extract distributions.
What it means
waitToProcessPendingReports() blocks on a Phaser until all pending sub-task reports have been processed by an executor, then shuts the executor down. If the await is interrupted or otherwise throws, the exception is wrapped in a generic ISE.
Source
Thrown at indexing-service/src/main/java/org/apache/druid/indexing/common/task/batch/parallel/PartialDimensionDistributionParallelIndexTaskRunner.java:253
}
private File getDistributionJsonFile(File intervalDir, String subTaskId)
{
return new File(intervalDir, subTaskId);
}
/**
* Waits for distributions from pending reports (if any) to be extracted.
*/
private void waitToProcessPendingReports()
{
log.info("Waiting to extract distributions from sub-task reports.");
try {
allReportsProcessedPhaser.arriveAndAwaitAdvance();
executor.shutdownNow();
}
catch (Exception e) {
throw new ISE(e, "Exception while waiting to extract distributions.");
}
}
private File createDistributionsDir()
{
File taskTempDir = getToolbox().getConfig().getTaskTempDir(getTaskId());
File distributionsDir = new File(taskTempDir, "dimension_distributions");
try {
FileUtils.mkdirp(distributionsDir);
return distributionsDir;
}
catch (IOException e) {
throw new ISE(e, "Could not create temp distribution directory.");
}
}
private void cleanupDistributionsDir()
{View on GitHub (pinned to 9b90983fd2)
Solutions
- Look at the wrapped cause and earlier log lines from the report-processing runnable for the real failure.
- Retry the batch task; phaser/interruption failures are usually transient.
- If reproducible, check for executor/thread pool configuration issues on the indexing service worker.
Defensive patterns
Strategy: retry
Try / catch
catch (IllegalStateException e) { if (e.getMessage().contains("Exception while waiting to extract distributions")) { log.error("cause", e.getCause()); retryTask(); } else { throw e; } } Prevention
- Avoid aggressive task-kill/interrupt during the distribution phase.
- Size worker thread pools adequately for parallel batch ingestion.
- Investigate the wrapped cause and prior logs for the underlying extraction failure.
When it happens
Trigger: A worker thread in the report-processing executor dies unexpectedly, or the awaiting thread is interrupted (task cancellation, supervisor shutdown) while allReportsProcessedPhaser.arriveAndAwaitAdvance() is in progress.
Common situations: Overlord/worker interruption during task kill; bugs in distribution extraction threads throwing before arriving at the phaser; JVM thread pool exhaustion on the Middle Manager.
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
- Lock[%s] is revoked
- Could not create group mapping [%s] due to concurrent update
- Could not delete group mapping [%s] due to concurrent update
- Could not create role [%s] due to concurrent update contenti
- Could not delete role [%s] due to concurrent update contenti
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/380367b529099492.
Report an issue: GitHub.