Puma: Puma dies w/ Errno::ECHILD after coming back from sleep

Created on 16 Aug 2019  路  3Comments  路  Source: puma/puma

Since I've upgraded puma to 4.1.0 it stops the webserver every time my machine goes to sleep. The worker times out and then it fails to restart/start the worker.

I tried to figure out what happens exactly, but I don't fully understand what it's doing. I do think that this is introduced with PR #1887

Steps to reproduce

1) bundle exec puma -C config/puma.rb.
2) Let Mac go to sleep en login again.

Expected behavior

Puma should still be running. Probably by restarting the timed out worker.

Actual behavior

Fails to restart worker.

[6170] ! Terminating timed out worker: 6243
bundler: failed to load command: puma (/Users/leon.kielstra/.rvm/gems/ruby-2.6.3/bin/puma)
Errno::ECHILD: No child processes
  /Users/leon.kielstra/.rvm/gems/ruby-2.6.3/gems/puma-4.1.0/lib/puma/cluster.rb:231:in `waitpid'
  /Users/leon.kielstra/.rvm/gems/ruby-2.6.3/gems/puma-4.1.0/lib/puma/cluster.rb:231:in `check_workers'
  /Users/leon.kielstra/.rvm/gems/ruby-2.6.3/gems/puma-4.1.0/lib/puma/cluster.rb:513:in `run'
  /Users/leon.kielstra/.rvm/gems/ruby-2.6.3/gems/puma-4.1.0/lib/puma/launcher.rb:188:in `run'
  /Users/leon.kielstra/.rvm/gems/ruby-2.6.3/gems/puma-4.1.0/lib/puma/cli.rb:80:in `run'
  /Users/leon.kielstra/.rvm/gems/ruby-2.6.3/gems/puma-4.1.0/bin/puma:10:in `<top (required)>'
  /Users/leon.kielstra/.rvm/gems/ruby-2.6.3/bin/puma:23:in `load'
  /Users/leon.kielstra/.rvm/gems/ruby-2.6.3/bin/puma:23:in `<top (required)>'

System configuration

Ruby version: 2.6.3
Rails version: 5.2.3
Puma version: 4.1.0
OS: MacOS

config/puma.rb

workers 1
port 8012
needs-repro

Most helpful comment

@nateberkopec I just tested with 4.1.1 and I did not receive the error. Thanks!

All 3 comments

I've observed this as well since upgrading.

System configuration

Ruby version: 2.5.3
Rails version: 5.2.3
Puma version: 4.1.0
OS: MacOS (10.14.6)

config/puma.rb

workers 1
threads 2, 8

To reproduce, I put the Mac in full sleep and awake it and log in. Testing just now, I see Errno::ECHILD: No child processes on 4.1.0, but the web server stays alive on 4.0.1. Hope that helps, let me know if I can provide more information.

Anyone see this on 4.1.1?

@nateberkopec I just tested with 4.1.1 and I did not receive the error. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

F4Ke picture F4Ke  路  4Comments

vprigent picture vprigent  路  3Comments

jchristie55332 picture jchristie55332  路  4Comments

gvpmahesh picture gvpmahesh  路  4Comments

nateberkopec picture nateberkopec  路  3Comments