[Bug 271460] ctld ports become inaccessible due to concurrent service restarts

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 12 Jun 2024 19:44:27 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271460

--- Comment #2 from Alan Somers <asomers@FreeBSD.org> ---
I've confirmed that the cause of the problem is that ctld opens its pidfile too
late.  It reads the current list of targets from the kernel, then reads the
config file, then opens its pidfile, and then applies changes based on the
differences between the kernel's state and the config file.  But the kernel's
state could've changed before the pidfile got opened.

I've hacked ctld to open the pidfile earlier and verified that this fixes the
problem.  However, doing it properly is hard, because the code for opening the
config file is intermingled with the code for interacting with the kernel.  The
biggest problem is the conf_pports list, added in
057abcb00413010898f3046f7704444b8f537bab .

-- 
You are receiving this mail because:
You are the assignee for the bug.