No graceful connection draining on shutdown in Rust (and TS): in-flight requests dropped on SIGTERM
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go, rust, typescript
Direzione di ricerca
Inizia dai loop accept di Rust e dai task serve_connection in corso, quindi confronta il comportamento di riferimento in go/main.go:92-97. Verifica il comportamento di TypeScript server.close() come indicato. Il lavoro è completato quando l’arresto impedisce le nuove connessioni, esaurisce le richieste attive per un massimo di 30 secondi e termina al completamento o alla scadenza del termine.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
On SIGTERM/SIGINT, the Go implementation drains in-flight requests via http.Server.Shutdown with a 30s timeout (go/main.go:92-97). The Rust implementation breaks its accept loops and exits main, which drops the tokio runtime — and with it any in-flight serve_connection tasks, aborting responses mid-flight.
Found during the code review of #27 (which rewrote the Rust shutdown path but preserved this pre-existing behavior — it is not a regression from that PR; the old single-listener code behaved the same way).
Affected implementation(s)
- Rust
- Go (reference behavior — already drains)
- TypeScript (worth auditing while at it: confirm
server.close()semantics wait for in-flight requests)
Expected behavior
On shutdown signal:
- Stop accepting new connections (already done).
- Allow in-flight requests to complete, up to a 30s deadline (matching Go).
- Exit after drain or deadline, whichever comes first.
Suggested fix (Rust)
Track connections in a tokio::task::JoinSet (or a counter + notify), and on shutdown call hyper's Connection::graceful_shutdown on active connections, then await the set with tokio::time::timeout(Duration::from_secs(30), ...).
Context
Split out from the review follow-ups on PR #27. Related: #25.
- Lingua principale
- Rust
- Stelle
- 2
- Fork
- 0
- Merge medio
- 9h 35m
- PR unite (30g)
- 6
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ChainSafe/docker-socket-policy
-
Type: Documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Priority: P1 Type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Priority: P2 Type: Enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Status: Break Change Type: Enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Process exits 0 (Rust) / hangs (Go) when all listeners fail to bind — defeats Restart=on-failure ApertaPriority: P2 Type: Bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 65/100
Tutte le issue di ChainSafe/docker-socket-policy
Issue simili
-
bug github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
registrystack/registry-stack#1393 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rocky-data/rocky#2181 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. Apertabot:ai-assisted component:indexer QA-roadmap status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
midnightntwrk/midnight-indexer#1557 ·