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

Aperta
#2,412 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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
28/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C
Stelle
3
Fork
7
Merge medio
3h 28m
PR unite (30g)
270

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di InauguralSystems/EigenScript

Tutte le issue di InauguralSystems/EigenScript

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.