Streaming request body errors are always reported as `internal`
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- backend-api-design
Direzione di ricerca
Start in connectrpc/src/service.rs tests and trace decode_request_body through the streaming body read path; compare its error handling with collect_body_limited. Reproduce the Limited body case and a body error containing a ConnectError, then check that the stream reports resource_exhausted or forwards the Connect error while unrelated errors remain internal. Keep the public API unchanged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The server reports every failure of a streaming request body as internal, whatever the error is. The unary path does not: collect_body_limited maps http_body_util::LengthLimitError to resource_exhausted.
This matters to a server that bounds a client- or bidi-streaming request in total, for example by wrapping the body in http_body_util::Limited, or with a body whose error is (or wraps) a ConnectError. The handler's request stream ends with internal: failed to read request body: ..., and the client cannot tell "too large" or "shedding load" from a broken transport.
Related but different: #321 (size-limit errors the client sees) and #150 (introduced surfacing body errors to handlers).
Repro (in connectrpc/src/service.rs tests, using decode_request_body):
// Limited's error is Box<dyn Error>, which is not an Error, so adapt it with
// a newtype that keeps the source.
let body = BodyExt::map_err(Limited::new(Full::new(two_messages), 12), Boxed);
let mut stream = decode_request_body(body, DEFAULT_MAX_MESSAGE_SIZE, None, registry);
let err = stream.next().await.unwrap().unwrap_err();
assert_eq!(err.code, ErrorCode::ResourceExhausted); // actual: Internal
The same happens when a body fails with a ConnectError (for example unavailable): the handler sees internal.
Proposed fix (PR to follow): the streaming internals only require B::Error: Display + Send today, while the public Service impl already requires std::error::Error + Send + Sync + 'static. Take the same bound internally, then on a body-read failure walk the error's source chain: a ConnectError is forwarded as it is, a LengthLimitError becomes resource_exhausted (matching the unary path), and anything else stays internal. No public API change.
- Lingua principale
- Rust
- Stelle
- 542
- Fork
- 74
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di connectrpc/connect-rust
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
connectrpc/connect-rust#358 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 53/100
connectrpc/connect-rust#355 ·
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 48/100
connectrpc/connect-rust#349 ·
-
Client fails 12 cases of connectconformance v1.0.7 (gRPC-Web bidi metadata, gRPC truncated server-stream message)Forse già presa @excavador l’ha presa 29 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
connectrpc/connect-rust#346 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
connectrpc/connect-rust#345 ·
Tutte le issue di connectrpc/connect-rust
Issue simili
-
nightly-cleanup
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
max-sixty/worktrunk#4939 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Flaky Test] tests::signer::v0::miner_recovers_when_broadcast_block_delay_across_tenures_occursApertaflaky
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
stacks-network/stacks-core#7918 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
New Mutants FoundAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rust-bitcoin/rust-bech32#339 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
databendlabs/openraft#2554 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
autofixer: follow-up
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
tursodatabase/turso#12683 ·
I maintainer di solito rispondono entro 1 giorno