Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc: Attempt to read trailers always when parsing grpc exception [DO NOT MERGE] #3185

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

DoumanAsh
Copy link

@DoumanAsh DoumanAsh commented Nov 25, 2024

This should prevent missing grpc-status in case of inability to read message correctly

Unless this is changed, any failure to read body will result in generic IO exception when grpc-status is in trailers

@DoumanAsh
Copy link
Author

I've been notified of #3087

Actually that makes sense if body read fails, but it doesn't make sense if body is just empty so I'm not sure if this PR is worth it

Copy link
Member

@oldergod oldergod left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Do you think you could write a test in GrpcClientTest ?

@DoumanAsh
Copy link
Author

Will do 👌

@DoumanAsh DoumanAsh force-pushed the fix_grpc_parser_missing_trailers_on_io_exception branch 2 times, most recently from 8762bfa to c05473c Compare November 25, 2024 14:48
@DoumanAsh DoumanAsh force-pushed the fix_grpc_parser_missing_trailers_on_io_exception branch from c05473c to 4b53174 Compare November 25, 2024 15:18
@DoumanAsh DoumanAsh changed the title grpc: Attempt to read trailers always when parsing grpc exception grpc: Attempt to read trailers always when parsing grpc exception [DO NOT MERGE] Nov 26, 2024
@DoumanAsh
Copy link
Author

DoumanAsh commented Nov 26, 2024

I tried to simulate situation that we encountered in wild but I think it doesn't go correctly through this part
https://github.com/square/wire/blob/master/wire-grpc-client/src/jvmMain/kotlin/com/squareup/wire/internal/RealGrpcCall.kt#L107-L109

For some reason even when I send empty body, it successfully passes despite exception supposed to be present
I'm not very familiar with internals but I guess this test suite doesn't simulate real client behavior

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