Allow accepting new connections during a graceful shutdown
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- rust
- Ambito
- networking
Direzione di ricerca
Inizia leggendo le posizioni Rust citate in hyper's proto/h1/dispatch.rs e proto/h1/conn.rs, quindi hyper-util's server/conn/auto/mod.rs. Traccia il modo in cui la cancellazione e l'arresto regolare influiscono sulle connessioni nuove e aggiornabili; il lavoro è completo quando il flag proposto consente di accettare connessioni durante la finestra iniziale di arresto applicando GOAWAY o connection: close, quindi smette di accettare connessioni dopo la scadenza minima.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is your feature request related to a problem? Please describe.
We want a very specific behavior for graceful shutdowns in our hyper-based proxy. We set two deadlines, min (typically 5-10s), and max (could be much longer). We want the following sequence during shutdown:
- t=0s: send GOAWAY on all HTTP2 connections and start responding with
connection: closeon all http1 requests. Continue to accept new connections, and handle them the same (GOAWAY/connection: close) them. - After
mindeadline: stop accepting new connections. Continue existing connections, with the sameGOAWAY/connection: close. - After
maxdeadline: shutdown everything.
The reason for the time when we accept new connections, but tell clients to go away, is that there is some time for the load balancers in front of the proxy (this could be something like AWS NLB, Kubernetes kube-proxy, etc) to de-register the proxy instance and stop sending traffic to it. So immediately dropping new connections results in downtime. However, during this time its nice to start to encourage clients to goaway, since its likely they will select another proxy instance (either because the fronting LB already de-registered the old instance (the min deadline is intended to be the worst case, so usually its much faster), or because of random chance it selects a different one).
Today, the best we can do is wait until after min deadline and stop accepting new connections and start GOAWAY/connection: close at the same time.
Describe the solution you'd like
A new flag on hyper_util::server::conn::auto, and on hyper::server::conn::http1 to enable the "different graceful shutdown mode" (naming TBD!). This would change:
- https://github.com/hyperium/hyper/blob/f9f8f44058745d23fa52abf51b96b61ee7665642/src/proto/h1/dispatch.rs#L97 - skip the close() call
- https://github.com/hyperium/hyper/blob/f9f8f44058745d23fa52abf51b96b61ee7665642/src/proto/h1/conn.rs#L878 - skip the close() call
- https://github.com/hyperium/hyper-util/blob/66afc93debef02548c86e8454e6bc01cf4fca280/src/server/conn/auto/mod.rs#L341 - do no error here
- https://github.com/hyperium/hyper-util/blob/66afc93debef02548c86e8454e6bc01cf4fca280/src/server/conn/auto/mod.rs#L525-L531 -- if
cancelled, then callgraceful_shutdown()on the newly served connections (and do the same for UpgradeableConnection)
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
If these changes are acceptable I would be happy to contribute both parts of the change
- Lingua principale
- Rust
- Stelle
- 16.4k
- Fork
- 1.8k
- Merge medio
- 2g 9h
- PR unite (30g)
- 14
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi 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 hyperium/hyper
-
C-feature
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
hyperium/hyper#2652 · 4 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug(ci): some warnings are not enforced by `features` stepForse già presa @cratelyn l’ha presa 2 giorni fa. ApertaA-tests C-bug
hyperium/hyper#4232 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Write a HIP for `Body::poll_progress()`Forse già presa @cratelyn l’ha presa 8 giorni fa. ApertaA-body B-rfc C-feature
hyperium/hyper#4228 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Upgraded HTTP/2 CONNECT streams cannot be reset, so a failed tunnel looks like a clean closeForse già presa @jeremyjpj0916 l’ha presa 18 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
Allow connection pools to stop reusing an HTTP/2 connection before its keep-alive timeoutForse già presa @jiahaoliang l’ha presa 36 giorni fa. ApertaC-feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
hyperium/hyper#4186 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hyperium/hyper
Issue simili
-
type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
stackabletech/operator-rs#1301 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
jmcnamara/rust_xlsxwriter#205 · 4 commenti ·
-
agent:triaged bug bughunt pm:pipenv priority:p1
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
SocketDev/socket-patch#1608 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
adorsys/status-list-server#698 ·
I maintainer di solito rispondono entro 2 giorni
-
Expose the dot grid colourAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nannou-org/egui_graph#92 ·
I maintainer di solito rispondono entro 1 giorno