common/io: Limit the queue buffer size for fair scheduling via tevent
authorAmitay Isaacs <amitay@gmail.com>
Wed, 21 Aug 2013 04:42:06 +0000 (14:42 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 10 Sep 2013 05:03:40 +0000 (15:03 +1000)
commitda21e4df641a668bbf379720fbfc556fdadf71a3
tree00ef79f486d1ea28c06f462bf5a1049e7fdcf5c9
parent91f522f928f28b3c3463963aedd71a251545b910
common/io: Limit the queue buffer size for fair scheduling via tevent

If we process all the data available in a socket buffer, CTDB can stay busy
processing lots of packets via immediate event mechanism in tevent.  After
processing an immediate event, tevent returns without epoll_wait.  So as long
as there are immediate events, tevent will never poll other FDs.  CTDB will
report this as "Event handling took xx seconds" warning.  This is misleading
since CTDB is very busy processing packets, but never gets to the point of
polling FDs.

The improvement in socket handling made it worse when handling traverse
control.  There were lots of packets filled in the socket buffer quickly and
CTDB stayed busy processing those packets and not polling other FDs and timer
events.  This can lead to controls timing out and in worse case other nodes
marking busy node as disconnected.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 92939c1178d04116d842708bc2d6a9c2950e36cc)
common/ctdb_io.c