Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MSP-Greg committed Sep 18, 2019
1 parent 5f9b9c3 commit ec3a4dc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/puma/cluster.rb
Expand Up @@ -220,8 +220,10 @@ def check_workers(force=false)
log "- Stopping #{w.pid} for phased upgrade..."
end

w.term
log "- #{w.signal} sent to #{w.pid}..."
unless w.term?
w.term
log "- #{w.signal} sent to #{w.pid}..."
end
end
end
end
Expand Down Expand Up @@ -271,6 +273,7 @@ def worker(index, master)
server = start_server

Signal.trap "SIGTERM" do
@worker_write << "e#{Process.pid}\n" rescue nil
server.stop
end

Expand Down Expand Up @@ -505,8 +508,11 @@ def run
w.boot!
log "- Worker #{w.index} (pid: #{pid}) booted, phase: #{w.phase}"
force_check = true
when "e"
# external term, see worker method, Signal.trap "SIGTERM"
w.instance_variable_set :@term, true
when "t"
w.term
w.term unless w.term?
force_check = true
when "p"
w.ping!(result.sub(/^\d+/,'').chomp)
Expand Down

0 comments on commit ec3a4dc

Please sign in to comment.