{"record":{"id":"15557f55aff03fed","repo":"apache/beam","slug":"dropped-unknown-stateresponse","errorCode":null,"errorMessage":"Dropped unknown StateResponse {}","messagePattern":"Dropped unknown StateResponse (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/BeamFnStateGrpcClientCache.java","lineNumber":185,"sourceCode":"    /**\n     * A {@link StreamObserver} which propagates any server side state request responses by\n     * completing the outstanding response future.\n     *\n     * <p>Also propagates server side failures and closes completing any outstanding requests\n     * exceptionally.\n     *\n     * <p>This implementation must never block since we use a direct executor.\n     */\n    private class InboundObserver implements StreamObserver<StateResponse> {\n      @Override\n      public void onNext(StateResponse value) {\n        LOG.debug(\"Received StateResponse {}\", value);\n        CompletableFuture<StateResponse> responseFuture;\n        synchronized (lock) {\n          responseFuture = outstandingRequests.remove(value.getId());\n        }\n        if (responseFuture == null) {\n          LOG.warn(\"Dropped unknown StateResponse {}\", value);\n          return;\n        }\n        if (value.getError().isEmpty()) {\n          responseFuture.complete(value);\n        } else {\n          responseFuture.completeExceptionally(new IllegalStateException(value.getError()));\n        }\n      }\n\n      @Override\n      public void onError(Throwable t) {\n        closeAndCleanUp(\n            t instanceof RuntimeException ? (RuntimeException) t : new RuntimeException(t));\n      }\n\n      @Override\n      public void onCompleted() {\n        closeAndCleanUp(new RuntimeException(\"Server hanged up.\"));","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/BeamFnStateGrpcClientCache.java#L167-L203","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Usually safe to ignore if it follows a cancelled/failed bundle; check for a prior bundle failure to confirm.","Look at runner-side state handling latency; reduce slow state sources (e.g. slow external state store).","Check for version mismatch between runner and SDK harness; upgrade both consistently.","If frequent, inspect for duplicate state requests or stream replays and report to Beam with logs."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"CompletableFuture<StateResponse> f = outstandingRequests.remove(id);\nif (f == null) { LOG.warn(\"Dropped unknown StateResponse {}\", value); return; }\n// then complete f; on caller side handle exceptionally with retry\nf.exceptionally(ex -> { /* retry state request or fail bundle */ return null; });","preventionTips":["Keep bundle abort/cancel handling consistent between runner and harness","Match runner and SDK harness versions","Watch for slow state backends causing timeouts and orphaned responses","Treat this warning as a symptom; find the earlier cancellation/timeout"],"tags":["java","apache-beam","grpc","state-handling"],"backgroundTag":"orphaned-response-dropped","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}