apache/druid · warning · ISE

Null queryRunner! Looks to be some segment unmapping action

Error message

Null queryRunner! Looks to be some segment unmapping action happening

What it means

In ChainedExecutionQueryRunner.make, each queryable contributed to the chain is null-checked before a callable is scheduled; a null runner means a segment was unmapped (closed and evicted) between when the segment list was built and when the query actually ran. Druid throws ISE instead of silently skipping data, since results would be incomplete.

Source

Thrown at processing/src/main/java/org/apache/druid/query/ChainedExecutionQueryRunner.java:101

    final QueryPlus<T> threadSafeQueryPlus = queryPlus.withoutThreadUnsafeState();

    final QueryContext context = query.context();
    final boolean usePerSegmentTimeout = context.usePerSegmentTimeout();
    final long perSegmentTimeout = context.getPerSegmentTimeout();
    return new BaseSequence<>(
        new BaseSequence.IteratorMaker<>()
        {
          @Override
          public Iterator<T> make()
          {
            // Make it a List<> to materialize all the values (so that it will submit everything to the executor)
            List<ListenableFuture<Iterable<T>>> futures =
                Lists.newArrayList(
                    Iterables.transform(
                        queryables,
                        input -> {
                          if (input == null) {
                            throw new ISE("Null queryRunner! Looks to be some segment unmapping action happening");
                          }

                          final AbstractPrioritizedQueryRunnerCallable<Iterable<T>, T> callable = new AbstractPrioritizedQueryRunnerCallable<>(
                              priority,
                              input
                          )
                          {
                            @Override
                            public Iterable<T> call()
                            {
                              try {
                                Sequence<T> result = input.run(threadSafeQueryPlus, responseContext);
                                if (result == null) {
                                  throw new ISE("Got a null result! Segments are missing!");
                                }

                                List<T> retVal = result.toList();
                                if (retVal == null) {

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Retry the query; Druid's failure usually resolves once segment unmapping settles and the broker re-plans against the new segment set.
  2. Check if a kill/compaction/retention task ran concurrently (overlord logs) and reschedule such maintenance away from query-heavy periods or use the timeline's grace behavior.
  3. Ensure brokers refresh their timelines promptly (tune druid.broker.cache / segment lifecycle, disable stale lookups) and that historicals aren't dropping segments under memory pressure (check druid.processing.numMergeBuffers and heap sizing).
  4. If reproducible without any segment churn, file a bug with the broker/historical logs — a null runner in a stable timeline indicates an internal race.
Defensive patterns

Strategy: retry

Try / catch

try {
  return queryRunner.run(query, responseContext);
} catch (ISE e) {
  if (e.getMessage().contains("Null queryRunner")) {
    return retryWithBackoff(query, 2); // segment set likely re-planned
  }
  throw e;
}

Prevention

When it happens

Trigger: A Historical/Mergeable queryable becomes null in the queryables iterable passed to make(): a segment dropped or replaced by a compaction/rebalance task while its reference was being handed to the query chain, typically under concurrent segment load/drop or broker/historical segment-handoff races.

Common situations: Queries racing with segment dropping (killing datasource segments), overlord/compaction swapping segments, historicals restarting while brokers still route to them, or retention rules dropping segments mid-query; frequently seen in autoscaling or aggressively compacting clusters.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/a64c0bf1ee51a0f5. Report an issue: GitHub.