apache/beam · warning

Dropped unknown StateResponse

Error message

Dropped unknown StateResponse {}

What it means

BeamFnStateGrpcClientCache.onNext receives StateResponses from the runner keyed by instruction id; if no matching outstanding request exists (the future was already removed, e.g. cancelled or timed out), the response cannot be routed anywhere and is dropped with this warning. It usually indicates a late response to a request the client stopped waiting for.

Solutions

  1. Usually safe to ignore if it follows a cancelled/failed bundle; check for a prior bundle failure to confirm.
  2. Look at runner-side state handling latency; reduce slow state sources (e.g. slow external state store).
  3. Check for version mismatch between runner and SDK harness; upgrade both consistently.
  4. If frequent, inspect for duplicate state requests or stream replays and report to Beam with logs.
Defensive patterns

Strategy: retry

Try / catch

CompletableFuture<StateResponse> f = outstandingRequests.remove(id);
if (f == null) { LOG.warn("Dropped unknown StateResponse {}", value); return; }
// then complete f; on caller side handle exceptionally with retry
f.exceptionally(ex -> { /* retry state request or fail bundle */ return null; });

Prevention

When it happens

Trigger: The runner sends a StateResponse whose id is not in outstandingRequests — because the request was completed exceptionally/cancelled, the bundle was aborted, or the harness restarted state handling before the response arrived.

Common situations: Bundle cancellation or failure while state requests are in flight; runner-side timeouts after the harness moved on; duplicated or replayed responses over the state gRPC stream; harness/runner version mismatches.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/15557f55aff03fed. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/BeamFnStateGrpcClientCache.java:185

    /**
     * A {@link StreamObserver} which propagates any server side state request responses by
     * completing the outstanding response future.
     *
     * <p>Also propagates server side failures and closes completing any outstanding requests
     * exceptionally.
     *
     * <p>This implementation must never block since we use a direct executor.
     */
    private class InboundObserver implements StreamObserver<StateResponse> {
      @Override
      public void onNext(StateResponse value) {
        LOG.debug("Received StateResponse {}", value);
        CompletableFuture<StateResponse> responseFuture;
        synchronized (lock) {
          responseFuture = outstandingRequests.remove(value.getId());
        }
        if (responseFuture == null) {
          LOG.warn("Dropped unknown StateResponse {}", value);
          return;
        }
        if (value.getError().isEmpty()) {
          responseFuture.complete(value);
        } else {
          responseFuture.completeExceptionally(new IllegalStateException(value.getError()));
        }
      }

      @Override
      public void onError(Throwable t) {
        closeAndCleanUp(
            t instanceof RuntimeException ? (RuntimeException) t : new RuntimeException(t));
      }

      @Override
      public void onCompleted() {
        closeAndCleanUp(new RuntimeException("Server hanged up."));

View on GitHub (pinned to 12126d8942)