diff options
author | Amitay Isaacs <amitay@gmail.com> | 2015-02-23 12:38:11 +1100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2015-02-24 12:29:30 +0100 |
commit | 04a061e4d19d5bdbd8179fb0fab8b0875eec243e (patch) | |
tree | ae6fc393bd3dfff37f43f78d0ee41349900892c8 /lib/async_req/async_sock.c | |
parent | 84d4270c8e4ec18e9f83722d6df1a07f70acaade (diff) | |
download | samba-04a061e4d19d5bdbd8179fb0fab8b0875eec243e.tar.gz samba-04a061e4d19d5bdbd8179fb0fab8b0875eec243e.tar.xz samba-04a061e4d19d5bdbd8179fb0fab8b0875eec243e.zip |
ctdb-io: Do not use sys_write to write to client sockets
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 or machines with single CPU.
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.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Feb 24 12:29:30 CET 2015 on sn-devel-104
Diffstat (limited to 'lib/async_req/async_sock.c')
0 files changed, 0 insertions, 0 deletions