FIX: Catch broken pipe errors

This commit is contained in:
Robin Ward 2017-05-04 15:50:35 -04:00
parent 777f1f0f47
commit 1b526ebd91
1 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class SocketServer
socket = nil socket = nil
begin begin
socket = server.accept socket = server.accept
rescue IOError rescue IOError, Errno::EPIPE
# socket was shut down or something catastrophic like that happened # socket was shut down or something catastrophic like that happened
return false return false
end end
@ -61,7 +61,7 @@ class SocketServer
end end
true true
rescue IOError => e rescue IOError, Errno::EPIPE
# nothing to do here, case its normal on shutdown # nothing to do here, case its normal on shutdown
rescue => e rescue => e
Rails.logger.warn("Failed to handle connection in stats socket #{e}") Rails.logger.warn("Failed to handle connection in stats socket #{e}")