Skip to content

run_http_tests.sh leaked all five HTTP servers on every run - #11

Merged
rustyconover merged 1 commit into
mainfrom
http-worker-cleanup
Oct 7, 2026
Merged

rustyconover merged 1 commit into
mainfrom
http-worker-cleanup

Conversation

@rustyconover

Copy link
Copy Markdown
Contributor

start_worker recorded each server with PIDS+=("$!"), but it was always
called as W_X=$(start_worker ...). A command substitution runs in a
subshell, so the append landed in the subshell's copy of PIDS and the
EXIT trap's cleanup iterated an empty array: every run, clean exit or not,
left all five vgi-example-worker --http servers running. Found as
batches of five orphaned workers (parent PID 1, hours old) on the shared
build host. The same subshell also swallowed start_worker's exit 1, so a
server that failed to announce its port left an empty URL and the run
carried on.

start_worker now sets STARTED_URL and is called directly, as the
boot_http_worker helpers in ci/ already do. Checked with a stub worker
and unittest replaced by true: 6 servers left behind before, 0 after,
all five URLs still resolved.

🤖 Generated with Claude Code

start_worker recorded each server with PIDS+=("$!"), but it was always
called as W_X=$(start_worker ...). A command substitution runs in a
subshell, so the append landed in the subshell's copy of PIDS and the
EXIT trap's cleanup iterated an empty array: every run, clean exit or not,
left all five `vgi-example-worker --http` servers running. Found as
batches of five orphaned workers (parent PID 1, hours old) on the shared
build host. The same subshell also swallowed start_worker's `exit 1`, so a
server that failed to announce its port left an empty URL and the run
carried on.

start_worker now sets STARTED_URL and is called directly, as the
boot_http_worker helpers in ci/ already do. Checked with a stub worker
and unittest replaced by true: 6 servers left behind before, 0 after,
all five URLs still resolved.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@rustyconover
rustyconover merged commit f737527 into main Oct 7, 2026
8 checks passed
@rustyconover
rustyconover deleted the http-worker-cleanup branch October 7, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant