myxce/scripts
Rongsong Shen 19052674bd
fix(autoscaler): run provider scripts with posix_spawn, not fork (bug-1969)
The scaler is multi-threaded (monitor and demand threads); invoke() forked
and, in the child, logged, snprintf'd and setenv()'d before execl(), which
can deadlock on a lock another thread held at fork time and block the
caller in waitpid() forever.

run_script() now posix_spawn()s `sh <script> -f <in.json>`: stdout and
stderr go to the output file through file actions, the provider variables
(PRO_CONF_DIR, PRO_DATA_DIR, PRO_LOG_DIR, PROVIDER_NAME) are passed as the
child's envp (provider_env()), the child starts with an empty signal mask
and default dispositions, and waitpid() retries on EINTR.

The scaler unit suite (scaler/testsuite) was never built; it is now the
meson test "autoscaler test", linked with -Wl,--wrap=fork so it counts
fork() calls during a provider call.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 14:41:02 +00:00
..
git-hooks feat(build): no fork in multi-threaded XCE processes, enforced by check-no-fork 2026-10-10 13:35:52 +00:00
tests feat(buglog): one Markdown record per bug, checked against a record standard 2026-09-28 03:40:11 +00:00
buglog.py feat(buglog): one Markdown record per bug, checked against a record standard 2026-09-28 03:40:11 +00:00
check-no-fork.py fix(autoscaler): run provider scripts with posix_spawn, not fork (bug-1969) 2026-10-10 14:41:02 +00:00
gitea-sync.py fix(gitea-sync): filter milestone issues with milestones=, adopt phase issues left by an interrupted run 2026-09-29 07:26:16 +00:00