{"record":{"id":"dda7c55e3cfeea12","repo":"apache/druid","slug":"no-value-yet","errorCode":null,"errorMessage":"No value yet","messagePattern":"No value yet","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/frame/processor/ReturnOrAwait.java","lineNumber":143,"sourceCode":"    return new ReturnOrAwait<>(null, await, null, false);\n  }\n\n  /**\n   * Return a result.\n   */\n  public static <T> ReturnOrAwait<T> returnObject(final T o)\n  {\n    return new ReturnOrAwait<>(o, null, null, false);\n  }\n\n  /**\n   * The returned result. Valid if {@link #isReturn()} is true.\n   */\n  @Nullable\n  public T value()\n  {\n    if (isAwait()) {\n      throw new ISE(\"No value yet\");\n    }\n\n    return retVal;\n  }\n\n  /**\n   * The set of channels the processors wants to wait for. Valid if {@link #isAwait()} is true.\n   *\n   * Numbers in this set correspond to positions in the {@link FrameProcessor#inputChannels()} list.\n   */\n  public IntSet awaitableChannels()\n  {\n    if (!hasAwaitableChannels()) {\n      throw new ISE(\"No await set\");\n    }\n\n    return awaitChannels;\n  }","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/frame/processor/ReturnOrAwait.java#L125-L161","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check isReturn() (or isAwait()) before calling value() and only extract the value in the return branch","Use returnOrNull() if you want a nullable extraction instead of manual state checks","Fix the caller loop so it resumes the processor via the awaitable channels/futures and only reads value() once run() returns a RETURN state"],"exampleFix":"// before\nT result = runOutcome.value();\n// after\nfinal T result = runOutcome.isReturn() ? runOutcome.value() : null;","handlingStrategy":"type-guard","validationCode":"if (outcome != null && outcome.isReturn()) { /* safe to call value() */ }","typeGuard":"boolean hasValue(ReturnOrAwait<?> o) { return o != null && o.isReturn(); }","tryCatchPattern":"try { result = outcome.value(); } catch (IllegalStateException e) { if (!e.getMessage().contains(\"No value yet\")) throw e; /* handle await state */ }","preventionTips":["Always branch on isReturn()/isAwait() before extracting values","Prefer returnOrNull() over raw value() when null is an acceptable 'not ready' signal","Write processor run loops that fully handle each ReturnOrAwait state"],"tags":["java","frame-processor","state-error"],"backgroundTag":"invalid-state-transition","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}