Repository navigation
Keep capacity worker pid files private and resolve Git without PATH (#1051) - #1187
Merged
Merged
Conversation
…1051) Container worker pid files lived at a predictable /tmp path written with plain redirection. They now live in a 0700 directory that must be a real directory owned by the adapter user, and each file is created with noclobber, so a planted, stale or symlinked file refuses the start or cleanup instead of being followed or overwritten. Cleanup keeps its start-time check before killing anything. capacity_suite and capacity_local_docker ran git through ambient PATH. Both now use capacity_suite.git_executable(): CAPACITY_GIT when set, else a fixed list of system installs, never PATH. Revision validation and the existing unknown-local-revision fallback are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1051) SonarCloud flagged the literal /tmp directory constant (python:S5443). The container scripts now take a plain file name, refuse anything with a slash or a leading dot, and keep it in ${TMPDIR:-/tmp}/durable-workflow-capacity-workers inside the container. Custody checks are unchanged. The tests drive the scripts through TMPDIR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
rmcdaniel
marked this pull request as ready for review
November 13, 2026 01:30
Member
Author
|
Security: PASS (head
|
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 13, 2026
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.



Closes #1051.
Pid files (
scripts/benchmark/capacity_matrix.py): container worker lifecycle files used to live at a predictable/tmp/durable-workflow-capacity-worker-<digest>.pidand were written with plain>redirection. Now:/tmp/durable-workflow-capacity-workers/, created0700. Both the start and cleanup scripts refuse (exit 42) unless that path is a real directory, not a symlink, owned by the adapter user.set -C(noclobber) withumask 077. A stale or planted file refuses the start (exit 43) instead of being overwritten./proc/<pid>/statstart-time match before sending any signal (exit 41 on mismatch).WORKER_PIDFILE_SCRIPT,WORKER_CLEANUP_SCRIPT), so the tests run exactly whatdocker execruns.Git (
capacity_suite.py,capacity_local_docker.py): bothgit rev-parse HEADcalls go throughcapacity_suite.git_executable(). That'sCAPACITY_GITif set (it must be absolute and executable), else the first of/usr/bin/git,/usr/local/bin/gitand/opt/homebrew/bin/git, and never PATH. The 40-hex revision check incapacity_local_dockerand the existingunknown-local-revisionfallback incapacity_suiteare unchanged. A missing Git is aTopologyErrorin the local Docker runner.Tests (
tests/Unit/Support/capacity_benchmark_test.py), all inert, with no workload, Docker or Server:test_worker_pid_files_are_private_and_exclusiveruns the real scripts with the localshand checks:0700directory and0600file;test_git_is_resolved_without_path:CAPACITY_GITis honored; a relative or missing value refuses (and_git_revisionfalls back as before); agiton PATH is never chosen.Locally the file runs 59 tests. The only 3 errors need
php/cargoon PATH (binding conformance subtests) and are unrelated to this change.🤖 Generated with Claude Code