mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Rewrite Reactor#run_in_thread
- Log both error message and backtrace to STDERR - Reintroduce pipe closing when thread exits
This commit is contained in:
parent
74ea16df7f
commit
bd15892046
1 changed files with 11 additions and 10 deletions
|
@ -109,17 +109,18 @@ module Puma
|
|||
end
|
||||
|
||||
def run_in_thread
|
||||
@thread = Thread.new {
|
||||
while true
|
||||
begin
|
||||
run_internal
|
||||
break
|
||||
rescue StandardError => e
|
||||
STDERR.puts "Error in reactor loop escaped: #{e.message} (#{e.class})"
|
||||
puts e.backtrace
|
||||
end
|
||||
@thread = Thread.new do
|
||||
begin
|
||||
run_internal
|
||||
rescue StandardError => e
|
||||
STDERR.puts "Error in reactor loop escaped: #{e.message} (#{e.class})"
|
||||
STDERR.puts e.backtrace
|
||||
retry
|
||||
ensure
|
||||
@trigger.close
|
||||
@ready.close
|
||||
end
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
def calculate_sleep
|
||||
|
|
Loading…
Add table
Reference in a new issue