1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Merge pull request #1748 from MSP-Greg/cluster_check_workers

Cluster#check_workers - waitpid logic
This commit is contained in:
Evan Phoenix 2019-04-21 22:20:08 -07:00 committed by GitHub
commit d770c33ab3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,14 +216,9 @@ module Puma
# during this loop by giving the kernel time to kill them.
sleep 1 if any
while @workers.any?
pid = Process.waitpid(-1, Process::WNOHANG)
break unless pid
@workers.reject! { |w| Process.waitpid(w.pid, Process::WNOHANG) }
@workers.delete_if { |w| w.pid == pid }
end
@workers.delete_if(&:dead?)
@workers.reject!(&:dead?)
cull_workers
spawn_workers