431 and 414 responses sent by hyper or h2 never reach the Service, so metrics middleware can't record them
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- backend-api-design
Direzione di ricerca
Start by reading the hyper and h2 rejection paths named in the issue: proto/h1/role.rs and proto/streams/streams.rs. Trace how each path produces a 431 or 414 and consider where the server could expose the status to applications. Done means an application can observe these responses, including their status codes, for both HTTP/1.1 and HTTP/2.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
When a request is too large for the server's limits, hyper (HTTP/1.1) or h2 (HTTP/2) writes the error response itself, and the request never reaches the Service. Middleware that records each request never sees these responses, for e.g. an OpenTelemetry histogram or a tracing span.
Here's what is observable today (hyper 1.12.0, h2 0.4.20):
| Protocol | Rejection | Who responds | What the application gets |
|---|---|---|---|
| HTTP/1.1 | More than max_headers headers, or a head larger than max_buf_size | hyper, 431 (Server::on_error in proto/h1/role.rs) | The connection future returns Err, and is_parse_too_large() is true |
| HTTP/1.1 | URI longer than 65,534 bytes | hyper, 414 | The same: is_parse_too_large() is true. Only the Display text, "URI too long", distinguishes it from the 431 |
| HTTP/2 | Header list larger than max_header_list_size | h2, 431 followed by RST_STREAM (Streams::recv_headers in proto/streams/streams.rs) | Nothing. The connection keeps serving other streams and ends with Ok(()) |
For HTTP/1.1 we can approximate a metric from the connection error. To tell a 414 from a 431, though, we have to match on the error's Display string, and we have none of the request's attributes, such as its method. For HTTP/2 there is nothing to hook into: no error, event or callback reaches hyper or the application when h2 answers with a 431.
Describe the solution you'd like
Some way for a server application to learn that hyper or h2 answered a request on its own, and with which status code - not entirely sure what this should look like yet.
Describe alternatives you've considered
Not aware of any other ways to solve this yet
- Lingua principale
- Rust
- Stelle
- 16.4k
- Fork
- 1.8k
- Merge medio
- 1g 13h
- PR unite (30g)
- 12
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 hyperium/hyper
-
C-feature
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
hyperium/hyper#2652 · 4 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
False `SendRequest` readiness for HTTP/1 connectionsForse già presa @akasakariko l’ha presa 2 giorni fa. ApertaC-bug
Difficoltà 4/5 1-2 giorni Idoneità per principianti 55/100
hyperium/hyper#4246 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
I maintainer di solito rispondono entro 1 giorno
-
can't upgrade request that came in with `Connection: close, Upgrade`Forse già presa @akasakariko l’ha presa 2 giorni fa. ApertaC-bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
hyperium/hyper#4244 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hyperium/hyper
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
memory_patch_page drops the `#` of headings like `## Notes on C#`Forse già presa @viniciusdsandrade l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
akitaonrails/ai-memory#1859 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
wealthfolio/wealthfolio#2376 ·
I maintainer di solito rispondono entro 1 giorno
-
kind/bug kind/security
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
spiceai/spiceai#15826 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:cli bug dotnet good first issue priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rtk-ai/rtk#4844 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno