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

Enforce a minimum worker_timeout

This fixes a termination loop when the workers don't report in fast
enough.

Fixes #1714.
This commit is contained in:
Matthew Kent 2019-01-24 15:55:01 -08:00
parent 36964ec429
commit 64db36c01e

View file

@ -434,6 +434,13 @@ module Puma
# that have not checked in within the given +timeout+.
# This mitigates hung processes. Default value is 60 seconds.
def worker_timeout(timeout)
timeout = Integer(timeout)
min = Cluster::WORKER_CHECK_INTERVAL
if timeout <= min
raise "The minimum worker_timeout must be greater than the worker reporting interval (#{min})"
end
@options[:worker_timeout] = Integer(timeout)
end