apache/druid · error · IllegalStateException

No value yet

Error message

No value yet

What it means

ReturnOrAwait is the result type returned by FrameProcessor.run(), representing either a returned value or a request to await channels/futures. value() only yields a meaningful result when the state is RETURN; when the processor is in an AWAIT state there is no result yet, so an ISE is thrown. This is a state-misuse error by the processor runner, not a data error.

Solutions

  1. Check isReturn() (or isAwait()) before calling value() and only extract the value in the return branch
  2. Use returnOrNull() if you want a nullable extraction instead of manual state checks
  3. Fix the caller loop so it resumes the processor via the awaitable channels/futures and only reads value() once run() returns a RETURN state

Example fix

// before
T result = runOutcome.value();
// after
final T result = runOutcome.isReturn() ? runOutcome.value() : null;
Defensive patterns

Strategy: type-guard

Validate before calling

if (outcome != null && outcome.isReturn()) { /* safe to call value() */ }

Type guard

boolean hasValue(ReturnOrAwait<?> o) { return o != null && o.isReturn(); }

Try / catch

try { result = outcome.value(); } catch (IllegalStateException e) { if (!e.getMessage().contains("No value yet")) throw e; /* handle await state */ }

Prevention

When it happens

Trigger: Calling ReturnOrAwait.value() on the object returned by FrameProcessor.run() when that object is actually an await result (created via ReturnOrAwait.await... or awaitAll) instead of ReturnOrAwait.returnOrNull / the return variant.

Common situations: Custom FrameProcessor implementations or scheduler loops that ignore isReturn()/isAwait() and unconditionally call value() after run(); code written for a processor that returned a value, then the processor changed to await input channels first.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/frame/processor/ReturnOrAwait.java:143

    return new ReturnOrAwait<>(null, await, null, false);
  }

  /**
   * Return a result.
   */
  public static <T> ReturnOrAwait<T> returnObject(final T o)
  {
    return new ReturnOrAwait<>(o, null, null, false);
  }

  /**
   * The returned result. Valid if {@link #isReturn()} is true.
   */
  @Nullable
  public T value()
  {
    if (isAwait()) {
      throw new ISE("No value yet");
    }

    return retVal;
  }

  /**
   * The set of channels the processors wants to wait for. Valid if {@link #isAwait()} is true.
   *
   * Numbers in this set correspond to positions in the {@link FrameProcessor#inputChannels()} list.
   */
  public IntSet awaitableChannels()
  {
    if (!hasAwaitableChannels()) {
      throw new ISE("No await set");
    }

    return awaitChannels;
  }

View on GitHub (pinned to 9b90983fd2)