Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix phased restart with worker shutdown timeout #639

Merged
merged 3 commits into from
Jan 20, 2015

Conversation

ebeigarts
Copy link
Contributor

This pull request fixes phased restart with worker shutdown timeout.

This is from our production stderr log:

.../bundle/ruby/2.1.0/gems/puma-2.10.2/lib/puma/cluster.rb:76:in `term': undefined method `[]' for nil:NilClass (NoMethodError)
from .../bundle/ruby/2.1.0/gems/puma-2.10.2/lib/puma/cluster.rb:169:in `check_workers'
from .../bundle/ruby/2.1.0/gems/puma-2.10.2/lib/puma/cluster.rb:408:in `run'
from .../bundle/ruby/2.1.0/gems/puma-2.10.2/lib/puma/cli.rb:507:in `run'
from .../bundle/ruby/2.1.0/gems/puma-2.10.2/bin/puma-wild:31:in `<main>'

This bug was introduced in 2.10 with #566

lib/puma/cluster.rb:76:

if @first_term_sent && (Time.new - @first_term_sent) > @options[:worker_shutdown_timeout]

The problem is that @options are not passed down to cluster workers.

I also changed Events class a bit, so that it doesn't throw everything
to STDOUT/STDERR when in cluster mode.

@tmikoss
Copy link

tmikoss commented Jan 15, 2015

+1

evanphx added a commit that referenced this pull request Jan 20, 2015
Fix phased restart with worker shutdown timeout
@evanphx evanphx merged commit 2bcd98c into puma:master Jan 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants