Skip to content

client: fail truncated gRPC stream messages and report Trailers-Only trailers (#346) - #347

Open
excavador wants to merge 1 commit into
connectrpc:mainfrom
excavador:fix-conformance-v107
Open

excavador wants to merge 1 commit into
connectrpc:mainfrom
excavador:fix-conformance-v107

Conversation

@excavador

Copy link
Copy Markdown

Fixes #346.

What

Two fixes to the gRPC / gRPC-Web stream end, plus one conformance-harness change.
Together they make the client pass all 4618 cases of connectconformance v1.0.7
(it failed 12).

  • Truncated final message → internal. classify_grpc_end now turns a would-be
    clean end into internal ("stream ended with an incomplete message") when the
    EnvelopeAssembler still holds a partial envelope (has_partial()), i.e. the body
    stopped inside a 5-byte prefix or a payload and then grpc-status: 0 arrived.
    Failed ends keep their own classification (server error in the trailers, deadline,
    missing status).
  • Trailers-Only ends record their trailers. For a clean Trailers-Only end (empty
    body, grpc-status in the response headers, no trailers of its own),
    ServerStream::trailers() now returns the response headers minus content-type,
    as connect-go does, instead of None. headers() is unchanged.
  • Conformance harness, bidi: when the stream failed during response-head handling
    (e.g. a Trailers-Only error, which leaves BidiRecvHalf in Failed), report the
    headers/trailers carried by the returned ConnectError, as the server-stream path
    already does via connect_error_to_result.

Why

conformance v1.0.7 added server-stream/incomplete-message{,-prefix} (connectrpc/conformance#1159) and
changed the grpc-go reference server to defer half-duplex bidi headers (connectrpc/conformance#1177), so
gRPC-Web bidi streams with no responses now come back as Trailers-Only responses.

Tests

  • New unit tests in client::tests: Trailers-Only trailers, truncated payload and
    prefix before OK trailers, a trailer error keeping precedence, a past deadline
    keeping deadline_exceeded, gRPC-Web truncation.
  • connectconformance v1.0.7, default config: client 4618/4618, server 3620/3620.
    v1.0.5: client 4574/4574, server 3600/3600.

Bumping the pinned runner to v1.0.7 in download-conformance.sh / Taskfile.yaml
could follow separately.

This change was written with Claude Code.

🤖 Generated with Claude Code

…trailers (connectrpc#346)

A gRPC/gRPC-Web stream that ends part-way through an envelope and then
carries grpc-status 0 now ends with internal instead of a clean end. A
Trailers-Only clean end records the response headers (minus content-type)
as its trailers, as connect-go does. The conformance harness's bidi
handler reports the terminal error's metadata when the stream failed
during response-head handling.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Oleg Tsarev <[email protected]>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client fails 12 cases of connectconformance v1.0.7 (gRPC-Web bidi metadata, gRPC truncated server-stream message)

1 participant