From 30ea437cce324fd92393e4cd4a4d6686ee514a75 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 21 Oct 2014 01:11:28 +0000 Subject: unix_accepted: wait for readability on EAGAIN We only drop dead connections, not live ones. This is noticeable on my home machine when using the "powersave" CPU governor. --- lib/dtas/unix_accepted.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dtas/unix_accepted.rb b/lib/dtas/unix_accepted.rb index 491f45f..2c82d2a 100644 --- a/lib/dtas/unix_accepted.rb +++ b/lib/dtas/unix_accepted.rb @@ -57,6 +57,8 @@ class DTAS::UNIXAccepted # :nodoc: begin begin msg, _, _ = io.recvmsg_nonblock(nread) + rescue Errno::EAGAIN + return :wait_readable rescue EOFError, SystemCallError return nil end -- cgit v1.2.3-24-ge0c7