From 424f297d4b10e9c165285f81f0af92dad8cbf2db Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 3 Sep 2026 09:08:36 -0300 Subject: [PATCH] fix(xcat-core): the respawned monitor holds client sockets open for good The respawn is forked from the middle of the service loop, so the child inherits @pendingconnections -- the client sockets the parent has accepted and not yet handed to a worker. The monitor never serves one, and it outlives the worker that does, so its copy keeps that client's socket open until the daemon exits. Close them in the child, next to the listener and the rescanplugins channel it already drops. xcatd_install_monitor.t runs the lifted respawn block against stand-in descriptors and requires every pending connection to be closed. It fails without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-server/sbin/xcatd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 3fdcc0f7d..669a8a67e 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -1518,6 +1518,11 @@ until ($quit) { # would differ from the one forked at startup. close($chreadpipe); close($chwritepipe); + # A pending connection is a client socket the parent has accepted and not yet + # handed to a worker. The monitor never serves one, and it outlives the worker + # that does, so a copy left open here holds that client's socket for the life of + # the daemon. + close($_) for @pendingconnections; do_installm_service; xexit(0); } state => \$mon_respawn, pid => \$pid_MON, now => time();