431 and 414 responses sent by hyper or h2 never reach the Service, so metrics middleware can't record them
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Rust
- Star
- 16.4k
- Fork
- 1.8k
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 12
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của hyperium/hyper
-
Publicly reexport the http crateĐang mởC-feature
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
hyperium/hyper#2652 · 4 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
False `SendRequest` readiness for HTTP/1 connectionsCó thể đã có người làm @akasakariko đã nhận 3 ngày trước. Đang mởC-bug
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
hyperium/hyper#4246 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
can't upgrade request that came in with `Connection: close, Upgrade`Có thể đã có người làm @akasakariko đã nhận 3 ngày trước. Đang mởC-bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
hyperium/hyper#4244 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của hyperium/hyper
Issue tương tự
-
good first issue help wanted r-docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
servo/rust-smallvec#824 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
superradcompany/microsandbox#1974 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
priority middle
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
KATO-Hiro/AtCoderClans#12940 ·
Maintainer thường phản hồi trong vòng 1 ngày