Support for graceful shutdown
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 32/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- networking
Direzione di ricerca
Start with the httpuv server object and its connections callback, then review how server behavior is exposed at the R level. Trace the existing listener, HTTP, and WebSocket lifecycle before deciding where a shutdown state belongs. Done means existing connections can finish while new connections are rejected, with a usable R-level shutdown entry point.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
My motivation here is that to have some sort of graceful transition during Shiny deployments so that existing users don't immediately greyscreen. By this I mean that existing websocket/HTTP connections should continue to work but new connections cannot be made to the running server.
As an external example, the HTTP server from the Go standard library can be put into "shutdown" mode:
Shutdown works by first closing all open listeners, then closing all idle connections, and then waiting indefinitely for connections to return to idle and then shut down.
Which sounds like the right approach to me. Waiting indefinitely is fine for our usecase, since SIGKILL can be used to terminate the process eventually if it exceeds some timeout. (This is how Kubernetes works by default.)
There is an upstream issue on libuv for a direct "stop listening" API that links to various supporting discussions, but it has not been implemented.
The libuv thread above suggests emulating "stop listening" support by having the connections callback just call uv_close() right after calling uv_accept() (as simply not calling uv_accept will accumulate connections in the kernel). I believe httpuv could do when a "shutdown" flag has been set on the server object, although I'm not sure how this ought to be exposed at the R level.
This is mildly related to #226.
- Lingua principale
- C
- Stelle
- 252
- Fork
- 87
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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 rstudio/httpuv
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 46/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di rstudio/httpuv
Issue simili
-
Status: Opened
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
FriendsofECCE/ECCE#1018 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
immortalwrt/immortalwrt#2522 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
luainkernel/lunatik#2530 ·
I maintainer di solito rispondono entro 1 giorno