Repository navigation
Wait only for this run's vlt background processes - #222
Merged
Merged
Conversation
vlt_background_running matched every vlt child of the current user, so on a shared machine one benchmark run could wait on, or after 300s stop, another checkout's (or the user's own) vlt-cache-unzip. Each run now exports a unique BENCH_RUN_ID (variations/common.sh, registry/common.sh). vlt passes process.env to its detached children, so they inherit it, and vlt_background_pids only counts processes whose /proc/<pid>/environ holds this run's id (after the existing name and command-line match). The kill path stops only those pids. With BENCH_RUN_ID unset, behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
# Conflicts: # suite/scripts/clean-helpers.test.js
Member
Author
|
Merged main into this branch to pick up #223, which conflicted in 🤖 Generated with Claude Code |
lukekarrys
had a problem deploying
to
Benchmark
November 18, 2026 08:37 — with
GitHub Actions
Failure
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
vlt_background_running(suite/scripts/vlt-background.sh), used bywait_for_vlt_backgroundinclean-helpers.shand byadd-remove-state.sh, matched every process of the current user whose name starts withvlt-or whose command line is a/vlt/<name>-src-<name>.jsscript. In CI that is only the benchmark's own processes. On a shared machine (several benchmark audits running as the same user, plus the user's ownvltcommands) one run could wait on another checkout'svlt-cache-unzip, and after 300 s theclean-helpers.sh wait_for_vlt_backgrounddispatcherpkilled everyvlt-cache-unzipof the user, including other runs'.Fix
variations/common.shandregistry/common.shexport a uniqueBENCH_RUN_ID(<epoch>-<pid>-<random>) if unset. Every process the run starts inherits it: hyperfine's prepare/setup/cleanup,add-remove-state.sh,process-count.shand its strace'd install, and vlt itself. All five of vlt 1.8.0's detached spawns (cache-unzip,registry-clientrevalidate,rollback-remove,security-archive,cli-sdkupdate-check) pass{ ...process.env }to the child, so the children carry it too.vlt-background.shgainsvlt_background_pids: the existing name and command-linepgreps remain the first filter; whenBENCH_RUN_IDis set, a pid only counts if/proc/<pid>/environcontainsBENCH_RUN_ID=<this run's id>. A process that exits betweenpgrepand the read, or whoseenvironis unreadable, is not treated as ours.vlt_background_runningis now[ -n "$(vlt_background_pids)" ], soadd-remove-state.shis scoped too without changes.clean-helpers.shgainsstop_vlt_background, which kills only the matched pids; the dispatcher's timeout path uses it instead ofpkill -u <uid> vlt-cache-unzip. Since the wait covers all of the run's vlt children, the stop now covers the same set (before, onlyvlt-cache-unzip).BENCH_RUN_IDunset (a script run by hand): today's behaviour, every vlt child of the user counts.The id is per variation script (each sources one of the two
common.sh). A variation's last--cleanupand its closingwait_for_vlt_background clean_allalready wait for its own children before the next variation starts, so a new id per variation doesn't let work spill over.Verified
node --test suite/scripts/: 41 pass. New tests inclean-helpers.test.jsstart fakevlt-cache-unzip/*-src-*.jschildren with or without aBENCH_RUN_IDand check that: a child of this run is waited for; children of another run or of no run are ignored and not killed bystop_vlt_backgroundwhile this run's are; with no run id the helper waits for any run's child (fallback);vlt_background_runningmatches each of the three child shapes only for its own run.unshare --user --map-root-user --mount --forkwith the work dir bind-mounted outside/home, a fresh tmpfs on/home,HOME=/home/runner,npm_config_*/XDG_*unset, asserting[ ! -e /home/luke ]before the install:BENCH_RUN_ID=x vlt install --registry=https://registry.npmjs.org/on a 3-dependency project; the detached childpid=1971788 comm=vlt-cache-unziphadBENCH_RUN_ID=xandHOME=/home/runnerin/proc/<pid>/environ. The host's~/.cache/vltmtime was unchanged afterwards. A first attempt also caught avlt-cache-unzipfrom another benchmark audit running on the same box in a sibling namespace, whoseenvironwas unreadable: exactly the case the id filter now excludes.🤖 Generated with Claude Code