1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

ctdb-daemon: Close server socket when switching to client

The socket is set close-on-exec but that doesn't help for processes
that do not exec().  This should be done for all child processes.

This has been seen in testing where "ctdb shutdown" waits for the
socket to close before succeeding.  It appears that lingering
vacuuming processes have not closed the socket when becoming clients
so they cause "ctdb shutdown" to hang even though the main daemon
process has exited.  The cause of the lingering vacuuming processes
has been previously examined but still isn't understood.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2020-05-19 17:57:35 +10:00 committed by Amitay Isaacs
parent 62875044ec
commit e40d452722

View File

@ -2179,6 +2179,11 @@ int switch_from_server_to_client(struct ctdb_context *ctdb)
{
int ret;
if (ctdb->daemon.sd != -1) {
close(ctdb->daemon.sd);
ctdb->daemon.sd = -1;
}
/* get a new event context */
ctdb->ev = tevent_context_init(ctdb);
if (ctdb->ev == NULL) {