Skip to content

Commit

Permalink
Rescue close if needed
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <[email protected]>
  • Loading branch information
ganmacs committed Apr 26, 2019
1 parent 44cb301 commit 41d19a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/fluent/plugin/out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,12 @@ def revoke(key = Thread.current.object_id)
def clear
@mutex.synchronize do
@inactive_socks.values.each do |s|
s.sock.close
s.sock.close rescue nil
end
@inactive_socks.clear

@active_socks.values.each do |s|
s.sock.close
s.sock.close rescue nil
end
@active_socks.clear
end
Expand All @@ -606,7 +606,7 @@ def purge_obsolete_socks
# 0 means sockets stored in this class received all acks
if @inactive_socks[k].ref <= 0
s = @inactive_socks.delete(k)
s.sock.close
s.sock.close rescue nil
@log.debug("purged obsolete socket #{s.sock}")
end
end
Expand Down

0 comments on commit 41d19a3

Please sign in to comment.