myxce/.kiro
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
..
reviews docs(review): project and spec review: conflicts, code gaps, priorities 2026-10-10 08:11:08 +00:00
settings finalize configuration replication 2026-06-09 16:40:13 +08:00
specs docs(spec): resource-provisioner decisions and research (language, in-memory lease, orphan cleanup) 2026-10-10 13:46:58 +00:00
steering fix(autoscaler): run provider scripts with posix_spawn, not fork (bug-1969) 2026-10-10 14:41:02 +00:00