Skip to content

Add grpc-status trailers to fake gRPC responses - #1257

Merged
yuandrew merged 1 commit into
temporalio:mainfrom
yuandrew:fix-fake-grpc-trailers
May 12, 2026
Merged

yuandrew merged 1 commit into
temporalio:mainfrom
yuandrew:fix-fake-grpc-trailers

Conversation

@yuandrew

@yuandrew yuandrew commented May 12, 2026

Copy link
Copy Markdown
Contributor

What was changed

updated the two fake-success response builders to stream a final trailer frame containing grpc-status: 0

Why?

tonic version bumped, grpc/grpc-rust#2543

Our fake gRPC success responses are malformed, they send HTTP 200 plus a framed protobuf body, but they do not send the required final grpc-status: 0 trailer. Newer tonic correctly treats that as an invalid/truncated gRPC response, so tests fail with missing grpc-status trailer.

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

Note

Low Risk
Low risk: changes only how synthetic success responses are constructed by adding a standard gRPC trailer, with minimal impact beyond test/fake transports.

Overview
Updates the callback-based gRPC service and integration-test fake server helpers to stream a final trailers frame containing grpc-status: 0 after successful response data.

This replaces previous “data-only” success bodies with StreamBody/Frame-based bodies so responses are well-formed under newer tonic validation.

Reviewed by Cursor Bugbot for commit 99cd542. Bugbot is set up for automated code reviews on this repo. Configure here.

@yuandrew
yuandrew requested a review from a team as a code owner May 12, 2026 16:40
@yuandrew yuandrew changed the title Fix fake gRPC success trailers Add grpc-status trailers to fake gRPC responses May 12, 2026
@yuandrew
yuandrew merged commit c57f825 into temporalio:main May 12, 2026
102 of 107 checks passed
@yuandrew
yuandrew deleted the fix-fake-grpc-trailers branch May 12, 2026 21:18
yuandrew added a commit to yuandrew/sdk-rust that referenced this pull request May 13, 2026
yuandrew added a commit to yuandrew/sdk-rust that referenced this pull request May 14, 2026
yuandrew added a commit to yuandrew/sdk-rust that referenced this pull request May 14, 2026
yuandrew added a commit that referenced this pull request May 14, 2026
* Shutdown rpc initiate shutdown (#1224)

* Use ActivityOptions struct literal

* Add grpc-status trailers to fake gRPC responses (#1257)

---------

Co-authored-by: Spencer Judge <spencer@temporal.io>
yuandrew added a commit that referenced this pull request May 15, 2026
* Shutdown rpc initiate shutdown (#1224)

* Use ActivityOptions struct literal, formatting

* Add grpc-status trailers to fake gRPC responses (#1257)

---------

Co-authored-by: Spencer Judge <spencer@temporal.io>
FranzBusch pushed a commit to apple/swift-temporal-sdk that referenced this pull request Jul 15, 2026
### Motivation

The macOS test lanes on #159 fail with a worker `BridgeError` — "missing
grpc-status trailer, stream was terminated without a final status" on
the worker's first `get_system_info` call:

- #159
-
https://github.com/apple/swift-temporal-sdk/actions/runs/29327782027/job/87068156954

The cause is dependency drift. tonic 0.14.6
([grpc/grpc-rust#2543](grpc/grpc-rust#2543))
made the gRPC client reject an HTTP-200 response that carries no
grpc-status trailer, per the gRPC-over-HTTP/2 spec. sdk-core's gRPC
override builds success responses without that trailer and relied on
older tonic inferring OK from a trailerless 200. Our pinned core
`db65dd9` predates the upstream fix, so once it is rebuilt against tonic
0.14.6+ the worker fails on connect.

### Modifications

Move the `dependencies/sdk-core` submodule from `db65dd9` to `c57f825`,
the merge commit of
[temporalio/sdk-rust#1257](temporalio/sdk-rust#1257),
which appends a `grpc-status: 0` trailer to those override responses:

-
https://github.com/temporalio/sdk-core/blob/c57f825ff4a312d084773498fceeca9eef853607/crates/client/src/callback_based.rs#L107-L112

### Result

Once `build-temporal-core-artifacts.yml` reruns against the bumped
submodule and publishes a new release, the macOS worker lanes should
pass. A follow-up on #159 then bumps `Package.swift`'s `url` +
`checksum` (both `Bridge` and `BridgeDarwin`) to that release.

### Test Plan

Verified locally: built the sdk-core c-bridge staticlib from `c57f825`
(Rust 1.88, tonic 0.14.6), wrapped it into an xcframework, and ran a
worker connect + workflow-execution test. It passes end-to-end, where
the pre-fix core failed on the first `get_system_info`. Full CI
validation happens when the artifacts workflow republishes and #159
consumes the new release.

> [!NOTE]
> This bumps the Core SDK only; the artifact rebuild and consumer bump
follow. Once this is merged:
> - [ ] Trigger `build-temporal-core-artifacts.yml` via
`workflow_dispatch` to publish a release built from `c57f825`
(@FranzBusch)
> - [ ] Follow-up on #159 bumping `Package.swift`'s `url` + `checksum`
(both `Bridge` and `BridgeDarwin`) to the new release (@RalucaP)
>
> Separately might be worth a follow-up: the artifacts build doesn't pin
its Rust dependencies (no committed `Cargo.lock` / `--locked`), which is
what let this drift on a rebuild of the same commit, pinning would
prevent a recurrence.
RalucaP added a commit to RalucaP/swift-temporal-sdk that referenced this pull request Jul 16, 2026
Point both binary targets at the temporal-sdk-core-c57f825-2 release.
The db65dd9 binaries failed on macOS: the worker's first get_system_info
call returned "missing grpc-status trailer" because tonic 0.14.6 rejects
a trailerless HTTP-200, and that core predates the fix. c57f825
(temporalio/sdk-rust#1257) emits the trailer, so the worker connects and
runs.

Bump the Bridge artifactbundle and BridgeDarwin xcframework together so
Linux and Darwin build against the same core.
RalucaP added a commit to RalucaP/swift-temporal-sdk that referenced this pull request Jul 16, 2026
The db65dd9 xcframework hit "Multiple commands produce libTemporal.a" on
Xcode latest beta. apple#155 renamed the xcframework's internal library to
libTemporalBridge.a to clear that collision, so this bumps Package.swift
to a release built with the rename.

The core also has to move off db65dd9: rebuilding db65dd9 drifts onto
tonic 0.14.6, which rejects the trailerless HTTP-200 the worker's
get_system_info returns, failing every macOS worker test with "missing
grpc-status trailer". c57f825 (temporalio/sdk-rust#1257) emits the
trailer.

Point both binary targets at temporal-sdk-core-c57f825-2 (Bridge
artifactbundle + BridgeDarwin xcframework) so Linux and Darwin build
against the same core.
FranzBusch pushed a commit to apple/swift-temporal-sdk that referenced this pull request Jul 18, 2026
### Motivation

Bumps `Package.swift` to
[`temporal-sdk-core-c57f825-2`](https://github.com/apple/swift-temporal-sdk/releases/tag/temporal-sdk-core-c57f825-2),
which clears the two macOS failures on this PR:

- `Xcode latest beta` hit `Multiple commands produce libTemporal.a`.
#155 renamed the xcframework's internal library to
`libTemporalBridge.a`; this release is built with that rename, so the
collision is gone. (This is the unblock the PR was opened for.)
- The worker's first `get_system_info` call then failed with "missing
grpc-status trailer": rebuilding `db65dd9` drifts onto tonic 0.14.6,
which rejects a trailerless HTTP-200. c57f825
([temporalio/sdk-rust#1257](temporalio/sdk-rust#1257))
emits the trailer.

### Modifications

Point both binary targets at the release: `Bridge` (artifactbundle) and
`BridgeDarwin` (xcframework), updating `url` and `checksum` on each.
Bumped together so Linux and Darwin build against the same core.

### Test Plan

- [x] CI green (the Xcode-beta collision + the macOS worker lanes).
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.

2 participants