1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00
samba-mirror/ctdb/common
Amitay Isaacs 289201277c ctdb-common: Avoid race between fd and signal events
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13895

In run_proc, there was an implicit assumption that when a process exits,
fd event (pipe between parent and child) would be processed first and
signal event (SIGCHLD for the child) would be processed later.

However, that is not the case.  SIGCHLD can be received asynchronously
any time even when the pipe data has not fully been read.  This causes
run_proc to miss some of the output from child process in tests.

When SIGCHLD is being processed, if the pipe between parent and child is
still open, then do an explict read from the pipe to ensure we read any
data still in the pipe before closing the pipe.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Apr 12 08:19:29 UTC 2019 on sn-devel-144
2019-04-12 08:19:29 +00:00
..
cmdline.c ctdb-common: Fix CID 1435599 2018-05-16 07:03:53 +02:00
cmdline.h ctdb-common: Add command line processing abstraction 2018-05-12 12:06:28 +02:00
comm.c ctdb-common: Fix use-after-free error in comm_fd_handler() 2017-02-16 05:26:08 +01:00
comm.h spelling of associated 2019-02-13 04:15:14 +01:00
common.h ctdb-common: Drop debugging variable CTDB_EXTERNAL_TRACE 2018-03-01 19:39:15 +01:00
conf_tool.c debug: Use debuglevel_(get|set) function 2018-11-08 11:03:11 +01:00
conf_tool.h ctdb-common: Add config options tool 2018-05-12 12:06:28 +02:00
conf.c ctdb-common: Process the whole config file even if an error occurs 2018-09-03 10:52:11 +02:00
conf.h ctdb-common: Add config file parsing code 2018-05-12 12:06:28 +02:00
ctdb_io.c ctdb: buffer write beyond limits 2019-02-22 02:08:07 +01:00
ctdb_ltdb.c ctdb-daemon: Add accessors for CTDB_DB_FLAGS_REPLICATED flag 2017-06-29 10:34:27 +02:00
ctdb_util.c ctdb-common: Use sin6_len only if the structure supports it 2018-07-02 08:51:20 +02:00
db_hash.c ctdb-common: Add traverse_update function to db_hash abstraction 2017-04-05 04:47:23 +02:00
db_hash.h ctdb-common: Add traverse_update function to db_hash abstraction 2017-04-05 04:47:23 +02:00
event_script.c ctdb-common: Factor out basic script abstraction 2018-07-28 17:14:11 +02:00
event_script.h ctdb-common: Factor out basic script abstraction 2018-07-28 17:14:11 +02:00
hash_count.c ctdb-common: Add hash_count abstraction 2017-04-05 04:47:23 +02:00
hash_count.h ctdb-common: Add hash_count abstraction 2017-04-05 04:47:23 +02:00
line.c ctdb-common: Add line based I/O 2018-07-28 03:50:11 +02:00
line.h ctdb-common: Add line based I/O 2018-07-28 03:50:11 +02:00
logging_conf.c ctdb-common: Add config options for logging 2018-05-12 12:06:28 +02:00
logging_conf.h ctdb-common: Add config options for logging 2018-05-12 12:06:28 +02:00
logging.c ctdb: Fix an out of bound array access 2018-11-14 05:07:15 +01:00
logging.h ctdb-common: Add a function to validate logging specification 2018-05-12 12:06:28 +02:00
path_tool.c debug: Use debuglevel_(get|set) function 2018-11-08 11:03:11 +01:00
path_tool.h ctdb-common: Add path tool 2018-05-12 12:06:28 +02:00
path.c ctdb-common: Allow path_socket() to use $CTDB_SOCKET 2018-11-06 07:16:13 +01:00
path.h ctdb-common: Add path support for datadir 2018-07-11 11:48:38 +02:00
pidfile.c ctdb-common: Reimplement pidfile_context_create() using pidfile_path_create() 2017-08-02 07:28:44 +02:00
pidfile.h ctdb-common: Rename pidfile_create() -> pidfile_context_create() 2017-08-02 03:39:11 +02:00
pkt_read.c ctdb-common: Add packet read abstraction 2015-10-07 14:53:28 +02:00
pkt_read.h ctdb-common: Add packet read abstraction 2015-10-07 14:53:28 +02:00
pkt_write.c ctdb-common: Add packet write abstraction 2015-10-07 14:53:28 +02:00
pkt_write.h ctdb-common: Add packet write abstraction 2015-10-07 14:53:28 +02:00
rb_tree.c Correct "occured" typos. 2017-02-22 08:26:21 +01:00
rb_tree.h Added some #ifndefs to stop files being included multiple times. 2011-11-11 14:31:50 +11:00
reqid.c ctdb-common: Add request id abstraction 2015-10-07 14:53:28 +02:00
reqid.h ctdb-common: Add request id abstraction 2015-10-07 14:53:28 +02:00
run_event.c ctdb-common: Use script abstraction in run_event 2018-07-28 17:14:11 +02:00
run_event.h ctdb-common: Add support to run events through failure 2018-06-05 22:34:19 +02:00
run_proc.c ctdb-common: Avoid race between fd and signal events 2019-04-12 08:19:29 +00:00
run_proc.h Fix spelling s/allows to/allows one to/ 2018-05-12 02:09:25 +02:00
sock_client.c ctdb: Check return values of tevent_req_set_endtime() 2018-05-17 01:09:46 +02:00
sock_client.h Fix spelling s/allows to/allows one to/ 2018-05-12 02:09:25 +02:00
sock_daemon.c ctdb-common: Set close-on-exec for startup fd 2018-10-22 06:04:20 +02:00
sock_daemon.h ctdb-common: Set close-on-exec for startup fd 2018-10-22 06:04:20 +02:00
sock_io.c ctdb-common: Use correct return type for tevent_queue_add_entry 2018-07-04 23:56:42 +02:00
sock_io.h ctdb-common: Refactor code to remove a stale socket 2017-02-17 10:44:14 +01:00
srvid.c ctdb-common: Extend srvid_exists() check to support optional private_data 2017-09-21 08:53:26 +02:00
srvid.h ctdb-common: Extend srvid_exists() check to support optional private_data 2017-09-21 08:53:26 +02:00
system_socket.c ctdb:common: Use C99 initializer for 'struct ifreq' 2019-01-28 10:29:21 +01:00
system_socket.h ctdb-common: Drop function parse_ip_mask() and supporting functions 2018-07-27 05:45:21 +02:00
system.c ctdb: Use #ifdef instead of #if for config.h definitions 2018-11-28 23:19:21 +01:00
system.h ctdb-common: Drop unused function mkdir_p_or_die() 2018-07-27 08:42:20 +02:00
tunable.c ctdb: Use C99 initializer for last element of tunables 2019-01-28 10:29:21 +01:00
tunable.h ctdb-common: Refactor tunable related functions 2016-07-25 21:29:46 +02:00