Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Phased restart stops Puma when the plugin is on and workers take a moment to boot

Aperta Adatta ai principianti
#89 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à
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
ruby
Ambito
backend

Direzione di ricerca

Inizia leggendo il metodo stop_litestream del plugin e il controllo del monitor che registra "Detected Litestream has gone away"; l'issue non indica i relativi file né i test. Traccia come cambia @litestream_pid durante before_restart e after_booted, quindi riproduci il problema con due worker e un config.ru ritardato. Il lavoro è completato quando i riavvii per fasi funzionano con avvii dei worker di 1 e 4 secondi e Puma si arresta quando Litestream viene terminato.

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

Descrizione

With plugin :litestream in cluster mode, a phased restart (pumactl phased-restart / USR1) stops Puma if the workers take a second or more to boot, which a Rails app always does.

before_restart stops Litestream at the start of the phased restart, but after_booted, which starts it again, fires only once every worker has rebooted (Cluster#run, in_phased_restart && workers_not_booted.zero?). Until then the monitor, which checks every 2 seconds, finds the old pid gone, logs "Detected Litestream has gone away, stopping Puma..." and sends INT to Puma.

- Worker 1 (PID: 3706119) booted in 1.0s, phase: 0
Stopping Litestream...
- Starting phased worker restart, phase: 1
- Worker 0 (PID: 3706319) booted in 1.0s, phase: 1
- Stopping 3706119 for phased upgrade...
Detected Litestream has gone away, stopping Puma...
- Goodbye!

To reproduce on 0.16.1 with 2 workers, preload_app! false and a config.ru that sleeps before run:

Worker boot time Puma 8.0.2 Puma 6.6.1
0 s survives, Litestream restarts survives
1 s stops stops
4 s stops stops

Hot restarts aren't affected: exec replaces the process before the monitor runs again. Single mode has no phased restart.

A small fix that works on both Puma versions: have stop_litestream clear @litestream_pid before stopping it, so the monitor skips its check until after_booted starts the next one. With that, Puma survives a phased restart at 1 s and 4 s boot times, and still stops when Litestream is killed. Happy to send it as a PR.

Lingua principale
Ruby
Stelle
280
Fork
32
Merge medio
9h 13m
PR unite (30g)
7

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 fractaledmind/litestream-ruby

Tutte le issue di fractaledmind/litestream-ruby

Issue simili

Altre issue su Ruby

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.