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>
Thu, 22 Aug 2013 04:08:52 +0000 (14:08 +1000)
commit92939c1178d04116d842708bc2d6a9c2950e36cc
tree367cf663ffbd06ed2f203b4ef6c6748bdd53da98
parentd8b094e804efc53fae9f44c6ef961b7b5797d290
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>
common/ctdb_io.c