From d3ecf49abeda931e23023e1afb93d4c6145f559a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 27 Jul 2010 17:03:37 +0000 Subject: event_machine: prevent double close of client socket Not sure where this is happening, but this can trigger Errno::EBADF under heavy load. --- lib/rainbows/event_machine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rainbows/event_machine.rb b/lib/rainbows/event_machine.rb index c290a07..7fe9864 100644 --- a/lib/rainbows/event_machine.rb +++ b/lib/rainbows/event_machine.rb @@ -150,7 +150,7 @@ module Rainbows def unbind async_close = @env[ASYNC_CLOSE] and async_close.succeed @body.respond_to?(:fail) and @body.fail - @_io.close + @_io.close unless @_io.closed? end end -- cgit v1.2.3-24-ge0c7