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

Martin Schwenke martin at meltin.net
Tue Feb 24 01:59:06 MST 2015


On Tue, 24 Feb 2015 11:34:52 +1100, Amitay Isaacs <amitay at gmail.com>
wrote:

> 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.

Pushed to autobuild.

peace & happiness,
martin


More information about the samba-technical mailing list