1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00
samba-mirror/ctdb/common
Amitay Isaacs 04a061e4d1 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 (c1558adeaa).

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
2015-02-24 12:29:30 +01:00
..
cmdline.c ctdb: Change default debug level to NOTICE (2) 2015-02-18 05:34:06 +01:00
ctdb_fork.c ctdb-logging: Remove log ringbuffer 2014-10-06 12:34:32 +02:00
ctdb_io.c ctdb-io: Do not use sys_write to write to client sockets 2015-02-24 12:29:30 +01:00
ctdb_logging.c ctdb-logging: Rework debug level parsing 2014-10-28 05:42:04 +01:00
ctdb_ltdb.c ctdb-util: Rename db_wrap to tdb_wrap and make it a build subsystem 2014-09-10 01:36:15 +02:00
ctdb_message.c build: Fix tdb.h path to enable building with system TDB library 2013-06-14 16:45:27 +10:00
ctdb_util.c ctdb-daemon: Fix IP address comparisons for IPv6 addresses 2014-12-05 21:02:40 +01:00
rb_tree.c server: Replace BOOL datatype with bool, True/False with true/false 2012-05-28 11:22:25 +10:00
rb_tree.h Added some #ifndefs to stop files being included multiple times. 2011-11-11 14:31:50 +11:00
system_aix.c common/system: Add ctdb_set_process_name() function 2013-07-10 14:33:19 +10:00
system_common.c ctdb-common: Add some missing #includes 2014-09-10 01:36:14 +02:00
system_freebsd.c common/system: Add ctdb_set_process_name() function 2013-07-10 14:33:19 +10:00
system_gnu.c common/system: Add ctdb_set_process_name() function 2013-07-10 14:33:19 +10:00
system_kfreebsd.c common/system: Add ctdb_set_process_name() function 2013-07-10 14:33:19 +10:00
system_linux.c ctdb-daemon: Gratuitous ARP equivalent for IPv6 is neighbor advertisement 2014-12-05 21:02:41 +01:00
system_util.c ctdb-util: Log an error if there is no way to set scheduler 2014-09-17 07:29:10 +02:00