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:
parent
8c3ab553ba
commit
19a0c275a5
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue