https://github.com/behos/tonic-bidi-error
https://github.com/behos/tonic-bidi-error
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/behos/tonic-bidi-error
- Owner: behos
- License: apache-2.0
- Created: 2023-03-07T17:52:39.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T19:05:00.000Z (over 3 years ago)
- Last Synced: 2025-09-05T21:52:55.727Z (10 months ago)
- Language: Rust
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tonic-bidi-error
Simple setup to reproduce issue
https://github.com/hyperium/tonic/issues/848
## Example
Start the server with
```
RUST_LOG=info cargo run --release
```
Run the client example with
```
cargo run --example client_end_stream --release
```
The client creates 3 streams and closes 2 of them by dropping them. This causes them
to cancel.
The third one is closed with a broken pipe because the client goes away.
```
[2023-03-07T19:00:03Z ERROR tonic_bidi_error] caught error: Status { code: Unknown, message: "error reading a body from connection: stream error received: stream no longer needed", source: Some(hyper::Error(Body, Error { kind: Reset(StreamId(1), CANCEL, Remote) })) }
[2023-03-07T19:00:03Z ERROR tonic_bidi_error] caught error: Status { code: Unknown, message: "error reading a body from connection: stream error received: stream no longer needed", source: Some(hyper::Error(Body, Error { kind: Reset(StreamId(3), CANCEL, Remote) })) }
[2023-03-07T19:00:03Z ERROR tonic_bidi_error] caught error: Status { code: Unknown, message: "error reading a body from connection: stream closed because of a broken pipe", source: Some(hyper::Error(Body, Error { kind: Io(Custom { kind: BrokenPipe, error: "stream closed because of a broken pipe" }) })) }
```
All three end up with tonic status `Unknown`.