Skip to content

Commit

Permalink
shutdown won't block
Browse files Browse the repository at this point in the history
  • Loading branch information
frsyuki committed Jul 1, 2012
1 parent 975bf81 commit 73a317f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions lib/fluent/engine.rb
Expand Up @@ -174,13 +174,17 @@ def start
end

def shutdown
@started.reverse_each {|s|
begin
s.shutdown
rescue
$log.warn "unexpected error while shutting down", :error=>$!.to_s
$log.warn_backtrace
@started.map {|s|
Thread.new do
begin
s.shutdown
rescue
$log.warn "unexpected error while shutting down", :error=>$!.to_s
$log.warn_backtrace
end
end
}.each {|t|
t.join
}
end

Expand Down

0 comments on commit 73a317f

Please sign in to comment.