Skip to content

Fix H2 bidi streaming deadlock for gRPC reflection#601

Merged
haga-rak merged 1 commit into
mainfrom
fix/h2-bidi-streaming-deadlock
Apr 1, 2026
Merged

Fix H2 bidi streaming deadlock for gRPC reflection#601
haga-rak merged 1 commit into
mainfrom
fix/h2-bidi-streaming-deadlock

Conversation

@haga-rak
Copy link
Copy Markdown
Owner

@haga-rak haga-rak commented Apr 1, 2026

Summary

  • Fixes a deadlock in InternalSend where the proxy blocked on requestBodyTask after receiving response headers, preventing the response from being forwarded to the client
  • For gRPC bidirectional streaming (e.g. server reflection), the client waits for the response before half-closing the request stream, so the proxy must forward the response without waiting for the request body to complete
  • When ProcessResponse completes but the request body is still uploading, the request body task now continues in the background with a dedicated RsBuffer and CTS, allowing the orchestrator to forward the response immediately
  • Adds List_Services_Reflection_Through_Proxy integration test that runs grpcurl -insecure grpcb.in:9001 list (server reflection, no proto files) through the proxy

InternalSend blocked on requestBodyTask after receiving response headers.
For gRPC bidi streaming (e.g. server reflection), the client waits for
the response before half-closing, creating a deadlock: the proxy can't
forward the response until Send() returns, but the client won't finish
sending until it sees the response.

When ProcessResponse completes but the request body is still uploading,
let the request body task continue in the background with a dedicated
buffer and CTS so the orchestrator can forward the response immediately.

Also adds a reflection-based grpcurl integration test that exercises
this code path.
@haga-rak haga-rak added the bug Something isn't working label Apr 1, 2026
@haga-rak haga-rak merged commit 2499282 into main Apr 1, 2026
1 of 2 checks passed
@haga-rak haga-rak deleted the fix/h2-bidi-streaming-deadlock branch April 6, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant