common/io: Limit the queue buffer size for fair scheduling via tevent
commita61a4b1254e162f39ac22665868ec116a96815f3
authorAmitay Isaacs <amitay@gmail.com>
Wed, 21 Aug 2013 04:42:06 +0000 (21 14:42 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Thu, 22 Aug 2013 04:08:52 +0000 (22 14:08 +1000)
treee1514818502924098e0d4bb9c3bf2cba5809c9ab
parentcfb7f74fa2d95c0d5ff4b4fd01bb06b15baf3b4c
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>
(This used to be ctdb commit 92939c1178d04116d842708bc2d6a9c2950e36cc)
ctdb/common/ctdb_io.c