neolith run: say when a connection closes, and bound what it reads after a refusal

Aperta
#134 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
django, python

Direzione di ricerca

Start with src/neolith/_server.py and its tests after issue #129 has merged. Read how Django's WSGIRequestHandler.handle_one_request selects ServerHandler, then trace the server's response handling for draining, refused requests with unread bodies, and bodyless statuses. Done means the tests cover all three expected connection behaviors, including the documented case where draining starts after headers are sent.

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

Descrizione

bug help wanted

Found by running the HTTP connector (#128) against the provider endpoints (#129) on one tree. Three points about connections under neolith run:

  • Drain. A response that finishes while the host is draining carries no Connection: close, so the caller's pool keeps a connection the server is about to close, and the next call on it fails as unavailable. Expected: while draining, each response says Connection: close and the connection closes after it. One case stays and is documented: Drain that begins after the headers are sent.
  • An unread request body. After an early refusal, such as a call with no credential, the server reads the rest of the request body into memory in one read. Expected: it is discarded in fixed-size pieces up to a bound, and past the bound the connection is closed.
  • An empty reply. Every 204 closes the connection, because a response with no Content-Length is treated as unframed, so each empty reply costs the caller a new connection. Expected: a status that admits no body (1xx, 204, 304) keeps the connection.

All three need the server to build its own response handler, since Django's WSGIRequestHandler.handle_one_request names ServerHandler directly. runserver and the test live server keep Django's behaviour, and the documentation says so.

Scope: src/neolith/_server.py and its tests, once #129 has merged. The sentences of ADR 0011 that describe these are handled in #133.

Lingua principale
Python
Stelle
1
Fork
0
Merge medio
5h 30m
PR unite (30g)
85

Preparare l'ambiente

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 stack314/django-neolith

Tutte le issue di stack314/django-neolith

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.