http: a test cannot hold a connection between its answer and its close, and the read buffer is charged to the budget without being refused

Đang mở
#2,412 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
28/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c
Lĩnh vực
backend

Hướng nghiên cứu

Read the decision and completion criteria in this issue, then inspect the server's connection budget and read buffer handling; the payload does not name source or test files. Decide whether to add test-only visibility and worker control, refuse connections whose buffers exceed the budget, or document the existing bounds. Done means recording reasons for both decisions and satisfying the matching checks or documentation criteria.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

area:http kind:decision

Found while the bar for #2370's fix round was reviewed (three blind passes of the bar's new item on the budget for what all connections hold, EIGS_HTTP_MAX_BODY_TOTAL). Two things, both true of the server before #2370 as well.

1. Nothing lets a test see what the budget is charged, or hold a connection in the state after its answer. After an answer the server may go on reading from the connection for up to 2 seconds before it closes it. What a connection is still charged in that time (the 16,384 bytes it reads into; no longer its head's and body's room) can only be read from outside through the answers of other connections at an exact budget, and every such check depends on when a worker thread gets to run. Three versions of such a check were each shown, by a schedule a loaded machine can produce, to fail a correct server or to pass a wrong one. #2370's bar therefore pins what is charged while a request is read and that all of it is given back after the connection has ended, and does not pin the moment in between.

2. The 16,384 bytes a connection reads into are charged when the connection starts, without a check against the budget. The budget is checked when the room for a head or a body grows. So connections that have sent nothing yet can hold more than the budget: with EIGS_HTTP_MAX_BODY_TOTAL=82945, six idle connections are charged 98,304 bytes. The caps on connections bound it (256 connections are 4 MiB against the default budget of 128 MiB), and the reader before #2370 did the same with its first 8,192 bytes.

Decision to make

  • For 1: whether the server gets a way, for tests only, to report what is charged and to hold a worker after its answer until the test lets it go, and what form keeps it out of a normal run (a build for tests, not an environment variable a deployment could set).
  • For 2: whether a connection whose 16,384 bytes do not fit the budget is refused before the buffer is taken, and with what answer, so that the budget is a bound on what the connections hold; or the documents say that the budget bounds the heads and bodies and that the read buffers are bounded by the caps on connections.

Done when

  • The decision for each of the two is recorded here, with its reason.
  • If 1 is adopted: a check that a connection's head and body room is given back before the server goes on reading from an answered connection, and that its 16,384 bytes stay charged until it is closed, each shown red on a server that does otherwise (the room given back only at the close; the 16,384 bytes given back at the answer), with no wait on a clock deciding the result.
  • If 2 is adopted: with a budget of 82,945, a sixth idle connection is refused without its buffer being taken, shown by the check of 1 or by a count of what is held; the answer it gets is in docs/BUILTINS.md.
  • If either is rejected: docs/BUILTINS.md says what the budget does and does not bound, in a sentence that a test holds.

— Claude DevBox

Ngôn ngữ chính
C
Star
3
Fork
7
Merge trung bình
3 giờ 28 phút
Pull request đã merge (30 ngày)
270

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của InauguralSystems/EigenScript

Tất cả issue của InauguralSystems/EigenScript

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.