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

未关闭
#2,412 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
28/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
c
领域
backend

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
C
星标
3
派生
7
平均合并
3 小时 28 分钟
30 天内合并 PR
270

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

InauguralSystems/EigenScript 的其他 Issue

查看 InauguralSystems/EigenScript 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。