-
Notifications
You must be signed in to change notification settings - Fork 1k
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
improper error handling with from h2 reason::cancel -> tonic::code::unkown #848
Comments
Are you able to share a minimal reproducible example? |
not yet sorry i am not that skilled in rust. but if h2 will throws an error with reason::cancel and that is propagated by hyper's poll_inner fn at hyper/src/body/body.rs the downcast here will not catch it right? then it will be |
Hyper errors have h2 errors as the "source" which should get picked up by tonic. At least I remember doing a bunch of testing around that last time we worked on it. |
maybe its a version issue let me double check, close the report for now |
@davidpdrsn yep you are right hyper have h2 error as source. i have a quick question should we handle h2 error here since we are polling from the stream? i guess this is where the code known come from? will google how to repo bug with custom dependencies tmr. its way to late today. tonic/tonic/src/codec/decode.rs Line 151 in c62f382
|
updated desc reopen and will work towards an example tmr |
Though we have get fn from_h2_error(err: &h2::Error), but this is not exhaust. |
In this case you will need to downcast to the timeout error since you added that layer it looks like and tonic doesn't directly map those timeout errors on the server side iirc |
@lyang24 did you ever get a chance to get a repro? |
Hi @LucioFranco , here's a rough implementation reproducing the error handling |
This PR fixes how client side streaming is handled on the server side and improves overall source error matching. Fixes: - Correctly, detect h2 codes when its wrapped in a hyper error. - Cancelled requests from the client side during client streaming requests correctly return EOF (`None` from `Streaming::message()`) Closes #848
This PR fixes how client side streaming is handled on the server side and improves overall source error matching. Fixes: - Correctly, detect h2 codes when its wrapped in a hyper error. - Cancelled requests from the client side during client streaming requests correctly return EOF (`None` from `Streaming::message()`) Closes #848
Ok I have a fix here for it #1315 feel free to review it. |
This PR fixes how client side streaming is handled on the server side and improves overall source error matching. Fixes: - Correctly, detect h2 codes when its wrapped in a hyper error. - Cancelled requests from the client side during client streaming requests correctly return EOF (`None` from `Streaming::message()`) Closes #848
Bug Report
Version: latest
Platform: all (linux)
Crates
http_body, hyper, h2
Description
maybe Streaming::message need to handle h2 error?
tonic/tonic/src/codec/decode.rs
Line 151 in c62f382
called from here
tonic/tonic/src/client/grpc.rs
Line 193 in c62f382
I expected to see this happen:
Code::Cancelled, message: stream no longer needed
Instead, this happened:
code: Unknown, message: "error reading a body from connection: stream error received: stream no longer needed
Todo add minimal reproduce example
The text was updated successfully, but these errors were encountered: