[PATCH] ctdb-io: Do not use sys_write to write to client sockets

Amitay Isaacs amitay at gmail.com
Mon Feb 23 17:34:52 MST 2015


When sending messages to clients, ctdb checks for EAGAIN error code and
schedules next write in the subsequent event loop.  Using sys_write in
these places causes ctdb to loop hard till a client is able to read from
the socket.  With real time scheduling, ctdb daemon spins consuming 100%
of CPU trying to write to the client sockets.  This can be quite harmful
when running under VMs since it can make the VM non-responsive.

This regression was introduced when all read/write calls were replaced to
use sys_read/sys_write wrappers (c1558adeaa980fb4bd6177d36250ec8262e9b9fe).

The existing code backs off in case of EAGAIN failures and waits for an
event loop to process the write again.  This should give ctdb clients
a chance to get scheduled and to process the ctdb socket.

Please review and push if ok.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ctdb-io-Do-not-use-sys_write-to-write-to-client-sock.patch
Type: text/x-patch
Size: 2210 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150224/8bc2f715/attachment.bin>

More information about the samba-technical mailing list