Skip to content

CheckedForwardingClientCall should pass trailers from the caught exception#10356

Merged
temawi merged 3 commits intogrpc:masterfrom
yamasa:master
Jul 10, 2023
Merged

CheckedForwardingClientCall should pass trailers from the caught exception#10356
temawi merged 3 commits intogrpc:masterfrom
yamasa:master

Conversation

@yamasa
Copy link
Contributor

@yamasa yamasa commented Jul 7, 2023

StatusException thrown from checkedStart() may have trailers. Therefore, CheckedForwardingClientCall should pass the trailers to responseListener.onClose().

…ption

`StatusException` thrown from `checkedStart()` may have `trailers`. Therefore, `CheckedForwardingClientCall` should pass the `trailers` to `responseListener.onClose()`.
Copy link
Member

@ejona86 ejona86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this is changing a stable API. But it seems fair.

@ejona86 ejona86 requested a review from temawi July 7, 2023 17:18
@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jul 7, 2023
@grpc-kokoro grpc-kokoro removed kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run labels Jul 7, 2023
Comment on lines +240 to +241
Metadata trailers = trailersFromThrowable != null ? trailersFromThrowable : new Metadata();
responseListener.onClose(Status.fromThrowable(e), trailers);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could inline trailers, but I don't have strong feelings about it.

Suggested change
Metadata trailers = trailersFromThrowable != null ? trailersFromThrowable : new Metadata();
responseListener.onClose(Status.fromThrowable(e), trailers);
responseListener.onClose(Status.fromThrowable(e), trailersFromThrowable != null ? trailersFromThrowable : new Metadata());

@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jul 10, 2023
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jul 10, 2023
@temawi temawi merged commit 68e2992 into grpc:master Jul 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants