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

Improves the timeout message so folks know why always.

git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@328 19e92222-5c0b-0410-8929-a290d50e31e9
This commit is contained in:
zedshaw 2006-08-14 22:53:37 +00:00
parent 8c3ab553ba
commit 19a0c275a5

View file

@ -606,13 +606,14 @@ module Mongrel
def reap_dead_workers(reason='unknown')
if @workers.list.length > 0
STDERR.puts "#{Time.now}: Reaping #{@workers.list.length} threads for slow workers because of '#{reason}'"
error_msg = "Mongrel timed out this thread: #{reason}"
mark = Time.now
@workers.list.each do |w|
w[:started_on] = Time.now if not w[:started_on]
if mark - w[:started_on] > @death_time + @timeout
STDERR.puts "Thread #{w.inspect} is too old, killing."
w.raise(TimeoutError.new("Timed out thread."))
w.raise(TimeoutError.new(error_msg))
end
end
end