Allow accepting new connections during a graceful shutdown
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- rust
- Área
- networking
Línea de trabajo
Empieza leyendo las ubicaciones de Rust referenciadas en hyper's proto/h1/dispatch.rs y proto/h1/conn.rs, y después hyper-util's server/conn/auto/mod.rs. Sigue cómo la cancelación y el apagado ordenado afectan a las conexiones nuevas y actualizables; se considera terminado cuando el flag propuesto permite aceptar conexiones durante la ventana inicial de apagado, aplicando GOAWAY o connection: close, y deja de aceptar conexiones después del plazo mínimo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Rust
- Estrellas
- 16.4k
- Forks
- 1.8k
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hyperium/hyper
-
Publicly reexport the http crateAbiertoC-feature
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
hyperium/hyper#2652 · 4 reacciones ·
Los mantenedores suelen responder en 1 día
-
bug(ci): some warnings are not enforced by `features` stepPosiblemente ocupada @cratelyn la tomó hace 1 día. AbiertoA-tests C-bug
hyperium/hyper#4232 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Write a HIP for `Body::poll_progress()`Posiblemente ocupada @cratelyn la tomó hace 7 días. AbiertoA-body B-rfc C-feature
hyperium/hyper#4228 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Upgraded HTTP/2 CONNECT streams cannot be reset, so a failed tunnel looks like a clean closePosiblemente ocupada @jeremyjpj0916 la tomó hace 16 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
-
Allow connection pools to stop reusing an HTTP/2 connection before its keep-alive timeoutPosiblemente ocupada @jiahaoliang la tomó hace 34 días. AbiertoC-feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
hyperium/hyper#4186 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de hyperium/hyper
Issues similares
-
ai_p1 comp-message-queues
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
ClickHouse/ClickHouse#125890 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
storytold/photocraft#5710 ·
Los mantenedores suelen responder en 1 día
-
Two tests fail on a Windows checkout: a CRLF parse in feature_walk_tests, an 8.3 TEMP path in libraries_testsPosiblemente ocupada @CamWight la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
bherbruck/solvecraft#1186 · 1 comentario ·
-
area: screenshot audit bug good first issue priority: P3 security severity: info type: correctness
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
pierruno-labs/prowl#31 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
limitlessprojects/Go-Hybrid#50 ·
Los mantenedores suelen responder en 1 día