Skip to content

fix(review): let offload-review runs for different PRs run in parallel - #1434

Merged
amiddavid merged 3 commits into
mainfrom
fix/review-parallel
Nov 25, 2026
Merged

amiddavid merged 3 commits into
mainfrom
fix/review-parallel

Conversation

@amiddavid

Copy link
Copy Markdown
Collaborator

Summary

offload-review.sh is now safe to run for several PRs at the same time. Tooling only. No product behavior change. No data dependence change.

What we found

What changed

  • Fetch goes to refs/offload-review/pr<N>/head and /base. It writes no shared ref and no FETCH_HEAD.
  • The merge base uses the per-PR base ref.
  • A "cannot lock ref" error is tried again: 5 tries, 2 s apart.
  • --cleanup deletes the per-PR refs.
  • The lock holds the owner pid. A dead owner, or a lock with no pid older than 60 s, is removed. The error names the path and the pid.
  • One EXIT trap removes the skip folder and any lock this process holds.
  • New helpers are in scripts/offload-review/lib.sh, so the test can use them.
  • SKILL.md says runs for different PRs are safe in parallel.

How it was tested

Tests ran on macOS, Go 1.27.4 (no Go code changed).

  • New scripts/offload-review_test.sh: all pass. It covers 40 parallel per-PR fetches, the retry, a dead lock, an old pidless lock, a live lock, the EXIT trap and --cleanup.
  • The old fetch command, in parallel, failed 0 of 40 times in the loop. The race depends on timing, so the test cannot show it.
  • bash -n is clean. shellcheck is not installed here.
  • The script was not run against a real PR.

Refs #1430

The fetch wrote the shared ref refs/remotes/origin/<base>. Two runs at
the same time failed with "cannot lock ref". Each run now fetches into
refs/offload-review/pr<N>/{head,base}, and --cleanup deletes them.
A "cannot lock ref" error is tried again, up to 5 times.

The worktree lock now holds its owner's pid. A lock whose owner is
dead, or a lock with no pid older than 60 s, is removed. An EXIT trap
removes a lock this process holds.

Refs #1430

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session fresh 2 of 2 1 of 2 15d7e8b27acb approve

Verdict: approve

The change works as claimed. Runs for different PRs no longer share a ref, and a stale
worktree lock is removed. I found no defect that breaks a run. The points below are narrow
races and test nits. None blocks the merge.

Findings

None.

Non-blocking

  1. scripts/offload-review/lib.sh:30-33 — a three-run race can delete a live holder's lock.

    • What can fail: run A reads a dead pid and calls lock_take_stale. Run B takes the stale
      lock over first (rename, remove, new mkdir, new pid). A's mv then steals B's live lock.
      If a third run C locks while A holds the lock renamed away, A's mv back fails and A runs
      rm -rf -- "$gone", which deletes B's lock. B and C then both hold it.
    • Why it does not block: the window is two mv calls wide and needs three concurrent runs.
      The harm is one failed git worktree add, the same failure the lock existed to avoid
      before this PR. The next run recovers.
    • Fix: when the mv back fails, remove $gone only when its pid is dead, or leave it (it
      is a $lockdir.stale.<pid> name and cannot block anyone).
  2. scripts/offload-review/lib.sh:13 — kill -0 cannot tell a dead pid from a pid of another user.

    • For a pid owned by another user, kill -0 fails with EPERM. The code then treats a live
      lock as stale and removes it.
    • The lock sits in this user's .git, and the repo rules say the machines run as one user,
      so this needs a pid hand-off across users. Note only.
  3. scripts/offload-review/lib.sh:22,68 — BASHPID needs bash 4 or newer.

    • macOS /bin/bash is 3.2 and has no BASHPID. Under set -u the name reads as unbound
      and lock fails.
    • It works here: #!/usr/bin/env bash resolves to Homebrew bash 5.2, first on PATH. This is
      the first bash-4 dependency in this script. Worth one line in the header, or $$ where
      the subshell id does not matter.
  4. scripts/offload-review_test.sh:96 — the bare wait blocks about 30 s on the sleep 30 fixture.

    • wait with no argument waits for every job, including live (sleep 30 &). The
      kill "$live" after it is dead code: the sleep ends first. The test passes, but it spends
      half a minute doing nothing.
    • Fix: kill "$live" first, then wait, or wait on the specific pids.
  5. scripts/offload-review.sh:8-15 — the new env vars are not in the header.

    • OFFLOAD_LOCK_TRIES and OFFLOAD_FETCH_RETRY_SLEEP are read in lib.sh but the header
      documents only the other OFFLOAD_* vars. One line each would do.
  6. refs/offload-review/pr<N>/* stay until --cleanup. A PR that never gets a cleanup
    leaves two refs behind. They are small and --cleanup removes them. Note only.

What I checked

  • The full diff (4 files) and the whole scripts/offload-review.sh around each change.
  • The per-PR fetch: refspecs, --no-write-fetch-head, the retry on "cannot lock ref", and that
    no shared ref (refs/remotes/origin/*, FETCH_HEAD) is written. Two different PRs touch no
    common ref. The merge-base base now comes from refs/offload-review/pr<N>/base, fetched each
    run, so it stays current.
  • The lock state machine by hand: dead pid, live pid, pidless young lock (age check), pidless
    old lock, takeover by rename, restore on pid mismatch, the 60 s wait limit, and
    unlock_if_held. The wait paths are bounded by OFFLOAD_LOCK_TRIES; the takeover paths
    always make progress.
  • Bash semantics, verified with small probes on this machine: a subshell and a backgrounded
    function do not run the parent's EXIT trap (so attempt and run_reviewer subshells cannot
    delete $skipdir or another process's lock through the new global trap); lockdir is empty
    until line 181 and unlock_if_held guards it; Homebrew bash 5.2 is first on PATH.
  • The EXIT-trap rewrite: the old per-skipdir trap is fully replaced by the line-61 trap;
    early exits before skipdir=$(mktemp -d) are guarded.
  • The --cleanup path: delete_pr_refs removes only this PR's two refs, errors are ignored,
    and it runs after the open-PR check.
  • The test file, line by line: the stub gh answers every call the --cleanup path makes; the
    backends define only functions, so sourcing the copied scripts/offload-review in the temp
    repo is safe; the stub git retry test counts calls correctly and reaches the real git; the
    old-command comparison loop is informational only, as its comment says.
  • That nothing else in the repo calls the old lock/unlock or origin/$base_ref for this
    script, and that the new test follows the existing by-hand pattern of
    scripts/release/changed-since-green_test.sh (no CI wiring for shell tests, make lint is
    Go only).
  • Repo rules: no Go or library change, so no data-dependence row and no behavior-change
    approval is needed. The commit has a conventional title, Signed-off-by, and Assisted-By.
  • No tests were run (live tests not approved). The bash probes above are semantic checks of
    the shell, not runs of this repo's test files.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session fresh 1 of 2 1 of 2 15d7e8b27acb blocking

Verdict: blocking

Findings

  1. scripts/offload-review/lib.sh:59 — the fetch still writes the shared ref refs/remotes/origin/<base>, so the cross-PR isolation this PR promises does not hold.
    • What fails: two runs for different PRs with the same base branch still fight over one ref. Git updates refs/remotes/origin/main opportunistically on every fetch of refs/heads/main, also with an explicit per-PR destination refspec and --no-write-fetch-head. When that shared ref's lock is held, the whole fetch exits 1 with error: cannot lock ref 'refs/remotes/origin/main'. This is the exact error the commit message says it removed. Today the 5-try retry hides it, so parallel runs still succeed — but the fix is not structural, and the comment says it is.
    • Proof (git 2.50.1, probes in a temp clone):
      • git fetch -q --no-write-fetch-head origin "+refs/pull/1/head:refs/offload-review/pr1/head" "+refs/heads/main:refs/offload-review/pr1/base" moved refs/remotes/origin/main from the old commit to the fetched one.
      • The same command with refs/remotes/origin/main.lock present exits 1 and prints error: cannot lock ref 'refs/remotes/origin/main'.
      • So the claim in lib.sh:52-53 ("It writes neither the shared refs/remotes/origin/* ... runs for different PRs do not fight over a ref lock") is false, and the SKILL.md line "Each run fetches into its own refs" overstates it. The old code had the same shared write, so this is no regression — the change just does not deliver its central claim.
    • Fix: add --refmap= to the git fetch in fetch_pr_refs. Verified: with --refmap= the same fetch leaves refs/remotes/origin/main untouched, still updates both per-PR refs, and succeeds while the shared ref's lock is held. Then the comment in lib.sh:51-54 and the SKILL.md wording become true. Keep the retry as the backup it says it is.

Non-blocking

  • scripts/offload-review/lib.sh:38 — narrow race in lock_take_stale: when the lock it renamed away turns out to be live (pid differs), it moves it back. If that move-back fails because a third process created a new $lockdir in the window, the rm -rf -- "$gone" deletes a lock a live holder still believes it holds, and that holder's own unlock can then remove the third process's lock. Trigger: a stale lock, three waiters, and a microsecond window. Consequence: two concurrent git worktree add calls, which is what the lock prevents. A safer fallback: when the move-back fails, re-read $gone/pid and delete only when it is still the stale pid.
  • scripts/offload-review_test.sh:103 (case d) — the test runs the real --cleanup code with pr=1, which executes rm -f /tmp/offload-review-pr1-rules.md on the machine that runs the test. It deletes another run's live-test rules file if one is in flight for PR #1. Point the test at a scratch path, or note the side effect in the header.

What I checked

  • The full diff (4 files), the whole scripts/offload-review.sh before and after, lib.sh line by line, SKILL.md, and the backends that the changed code calls.
  • The test file scripts/offload-review_test.sh, case by case, including the stub git/gh paths, the copied scripts/ tree in case (d), and the glob and ref assertions. I did not run it (live tests not approved).
  • Bash trap semantics, by probe: subshells, command substitution and backgrounded functions list the inherited EXIT trap but do not run it on exit. So the attempt subshells cannot delete $skipdir from under the parent, and the single EXIT trap at offload-review.sh:61 is safe.
  • Git fetch semantics, by probe: opportunistic update of remote-tracking refs with explicit refspecs, the failure mode when that ref's lock is held, and that --refmap= suppresses the shared write (finding 1).
  • bash -n on all three changed shell files: clean. No shellcheck gate exists in CI for these files (consistent with the other *_test.sh scripts, which also run by hand).
  • The lock logic: dead-holder takeover, pidless-old takeover, live-holder wait, unlock_if_held in the EXIT trap, and the failure message. Traced each against the test cases.
  • Repo gates: no library or proxy code changes, so no behavior-change note and no data-dependence row is needed. No binaries or LFS files. The commit has Signed-off-by and Assisted-By.

Review round 1 on #1434 found that git still updates
refs/remotes/origin/<base> after a fetch with explicit refspecs.
--refmap= stops that, so a held lock on the shared ref no longer
fails the fetch.

- Add --refmap= to fetch_pr_refs, with a test that holds the lock on
  refs/remotes/origin/main. The same fetch without --refmap= fails.
- lock_take_stale leaves a renamed live lock if the move back fails.
- Work with bash 3.2: use BASHPID when it exists, else $$.
- Add OFFLOAD_RULES_DIR so the test does not delete a real rules file.
- Kill the sleep fixtures before wait in the test.
- Document the new variables in the script header.

Refs #1430

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Fixed in the new commit.

  • Blocking (shared ref): fetch_pr_refs now passes --refmap=. New test (f) holds refs/remotes/origin/main.lock. The fetch succeeds with no retry, and refs/remotes/origin/main does not move. The same fetch without --refmap= fails with "cannot lock ref", so the test can catch the bug.
  • lock_take_stale: if the move back fails, the renamed lock is removed only when its holder is dead. A live one stays under its .stale.* name.
  • Test (d): --cleanup reads the rules folder from OFFLOAD_RULES_DIR (default /tmp). The test uses a scratch folder.
  • bash 3.2: the lock uses BASHPID when it exists, else $$. The test passes with /bin/bash 3.2.57 and with the default bash. On 3.2 a subshell reports the script pid, so a killed subshell is detected only when the whole script is gone.
  • Test: the sleep fixtures are killed before wait.
  • Header: OFFLOAD_LOCK_TRIES, OFFLOAD_FETCH_RETRY_SLEEP and OFFLOAD_RULES_DIR are documented. The comment in lib.sh and the line in SKILL.md now say what is true.
  • Reviewer 2, note 2 (kill -0 on another user's pid): not changed. The lock sits in this user's .git.
  • Reviewer 2, note 6 (refs stay until --cleanup): not changed. --cleanup deletes them.

The previous commit read the pid with $(self_pid). A command
substitution is a new subshell with another BASHPID on bash 4+, so
the exit trap did not remove its own lock. Test (e) failed on bash 5.

Refs #1430

Assisted-By: Claude Opus 5.5
Signed-off-by: DAVID AMID <[email protected]>
@amiddavid

Copy link
Copy Markdown
Collaborator Author

Correction to my last comment. Commit 1 of this round broke test (e) on bash 5: unlock_if_held read the pid in a command substitution, which has its own BASHPID. The new commit fixes it. The test now passes with the default bash and with /bin/bash 3.2.57.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 2 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session resumed 2 of 2 2 of 2 9fbe52b965e5 approve

Verdict: approve

Both new commits are correct. The blocking finding from round 1 is fixed and proved by a
test. My probes confirm the two key fixes. What is left are nits. None blocks the merge.

Earlier findings

  • Reviewer 1, finding 1 (the fetch still writes refs/remotes/origin/<base>): fixed.
    fetch_pr_refs now passes --refmap=. I agree with the finding: my round-1 check said
    "no shared ref is written", and that was wrong. Git updates the remote-tracking ref
    opportunistically also with explicit per-PR refspecs.
    My own probe (git 2.50.1, temp clone) confirms the fix: with --refmap=, the fetch succeeds
    while refs/remotes/origin/main.lock is held, leaves refs/remotes/origin/main unmoved, and
    updates both per-PR refs. Without --refmap=, the same fetch fails with
    error: cannot lock ref 'refs/remotes/origin/main'. Test (f) asserts exactly this, plus the
    negative control. The lib.sh comment and the SKILL.md line now say what is true.
  • My note 1 and reviewer 1's note (three-run race in lock_take_stale): fixed. When the
    move back fails, the renamed lock is removed only when its holder is dead. A live one stays
    under its .stale.* name, which blocks nobody.
  • My note 3 (BASHPID needs bash 4): fixed. self_pid uses ${BASHPID:-$$}, and the
    trade-off on bash 3.2 is documented in the file.
  • My note 4 (the test's bare wait stalls 30 s): fixed. The sleep fixtures are killed
    before wait.
  • My note 5 and reviewer 1's note on --cleanup deleting a real /tmp rules file:
    fixed. OFFLOAD_RULES_DIR (default /tmp) is documented in the header, and the test
    uses a scratch folder. The rules file is written by the user, not by the script, so only the
    cleanup path needed the variable.
  • My note 2 (kill -0 cannot tell a dead pid from another user's pid): rejected by the
    author
    , reason: the lock sits in this user's .git. I checked the reason and accept it.
    The pid in the file is always written by this user's process. An EPERM can then only mean
    the holder died and the pid was reused, where removal is the right outcome.
  • My note 6 (per-PR refs stay until --cleanup): rejected, by design. Accepted.

The second commit (9fbe52b)

The fix is right and needed. Commit 6e85ec7 read the pid in unlock_if_held through
$(self_pid). A command substitution is a new subshell with its own BASHPID on bash 4+, so
the trap never matched its own lock. The final code compares against ${BASHPID:-$$} expanded
in the trap's own shell. I probed the final unlock_if_held with the real lib functions under
Homebrew bash 5.2 and /bin/bash 3.2.57: in both, an EXIT trap removes the lock its shell
holds and keeps a lock of another live process.

Findings

None.

Non-blocking

  1. scripts/offload-review/lib.sh:45 — kill -0 on an empty pid reads as dead.

    • If the move back fails and the renamed lock has no pid file yet (a new lock between its
      mkdir and its pid write), kill -0 "" fails and the renamed lock is removed.
    • This is the last sliver of the round-1 race. It needs the full three-run race plus that
      microsecond window. Harm is one transient git worktree add failure. A [ -n "$now" ]
      guard before the kill -0 would close it.
  2. scripts/offload-review/lib.sh:54 — on bash 3.2 only, the main script's EXIT trap can
    remove a lock a live attempt subshell holds.

    • On 3.2 a subshell reports $$, the script pid, so the main shell and the attempt write
      the same pid. A direct kill of the main script during ensure_wt then frees the lock
      while the attempt still works in it.
    • 3.2-only, needs a signal to the main script alone in a second-wide window, and the next
      run recovers. The author already documented the weaker 3.2 pid identity. Note only.
  3. scripts/offload-review_test.sh:125 — test (d) does not assert the scratch rules file was
    removed.
    It creates $d/rules/offload-review-pr1-rules.md but never checks it is gone.
    One [ ! -e ... ] would do.

What I checked

  • Last review: round 1, 15d7e8b, 2026-11-25T19:58:30Z
  • New commits read: 2 (6e85ec7 "stop the fetch from touching the shared origin ref",
    9fbe52b "read the lock owner pid in the same shell in the exit trap")
  • Read in full: 2 reviews, 2 comments, 0 inline comments (from the three files)
  • New items since my last review, and what I did about each:
    • Reviewer 1's round-1 review (20:00:06Z), blocking on the shared ref: verified the finding
      with my own git probe, then verified the --refmap= fix with the same probe. See above.
    • Author comment (20:02:20Z) with the fix list: checked every bullet in the diff. All match.
    • Author comment (20:04:34Z), the correction about $(self_pid) in the exit trap: read
      commit 9fbe52b, then probed the final unlock_if_held under bash 5.2 and 3.2.
  • The full new diff and the final files around each change: lib.sh in full,
    offload-review.sh lines 39-48 and 130-140, the SKILL.md paragraph, and test (f), (c) and
    (d) in full.
  • Test (f) logic by hand: the setup moves origin main forward and resets the local tracking
    ref back, so any opportunistic write would show; the assertions cover success under the held
    lock, no retry (SECONDS < 3 with a 100 s retry sleep), the tracking ref unmoved, the per-PR
    base current, and the negative control without --refmap=.
  • That OFFLOAD_FETCH_RETRY_SLEEP=100 on a function call stays set for the rest of the test
    shell (bash keeps such assignments after a function call). No later fetch hits
    "cannot lock ref", so it changes nothing.
  • That the writer of the rules file is the user (SKILL.md), not the script, so the
    OFFLOAD_RULES_DIR change in --cleanup alone is consistent.
  • Probes run by me (temp dirs, not this repo's test files): the --refmap= fetch behavior,
    and the exit-trap lock removal under two bash versions. I did not run
    scripts/offload-review_test.sh (live tests not approved). The author reports it passes on
    bash 5 and /bin/bash 3.2.57.
  • Repo rules: no Go or library change, so no data-dependence row and no behavior-change
    approval. Both commits have conventional titles, Signed-off-by, and Assisted-By.

@amiddavid amiddavid left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer Kind Started by Context Review Round Head Verdict
Reviewer 1 (glm, user of @amiddavid) GLM rits/zai-org/glm-5-3 via Claude Code 2.1.332 offload-review skill, @amiddavid's session resumed 1 of 2 2 of 2 9fbe52b965e5 approve

Verdict: approve

Findings

None.

Round-1 findings, resolved

  1. Mine, blocking (--refmap=): fixed. fetch_pr_refs now passes --refmap= (lib.sh:66). The comment in lib.sh and the line in SKILL.md now say what is true. Test (f) holds refs/remotes/origin/main.lock while origin main moves, and asserts: the fetch succeeds, no retry, the shared ref does not move, and the per-PR base ref does move. Its control runs the same fetch without --refmap= and must fail, so the test can catch the bug. I probed both branches with an empty lock file, as the test creates: without --refmap= the fetch prints error: cannot lock ref 'refs/remotes/origin/main'; with --refmap= it exits 0 and leaves the shared ref untouched. The isolation the PR promises now holds.
  2. Mine, non-blocking (lock race): fixed. lock_take_stale now removes a renamed lock only when its holder is dead (lib.sh:44). A live one stays under its .stale.* name. One residual path remains, under Non-blocking.
  3. Mine, non-blocking (test deletes a real /tmp file): fixed. --cleanup reads the folder from OFFLOAD_RULES_DIR (default /tmp), and the test uses a scratch folder.
  4. Reviewer 2, notes 1, 3, 4, 5: fixed. Note 1 is the same race as my item 2. Note 3 (BASHPID needs bash 4): self_pid and unlock_if_held use ${BASHPID:-$$}, which I probed under set -u on /bin/bash 3.2.57: BASHPID is unset there and $$ stays the script pid in a subshell, matching the code comment. Note 4 (the bare wait blocked 30 s): the fixture sleep is killed first now. Note 5 (env vars in the header): documented, and the docs match the code.
  5. Reviewer 2, notes 2 and 6: rejected by the author, and I accept the reasons. Note 2: kill -0 cannot tell a dead pid from another user's pid. The lock sits in this user's .git, and only this script writes the pid, so it needs a pid hand-off across users to matter. Note 6: per-PR refs stay until --cleanup. They are two small refs, and --cleanup removes them.

Non-blocking

  • scripts/offload-review/lib.sh:54 — unlock still removes $lockdir without checking the pid. In the round-1 window (a holder's lock renamed away by lock_take_stale, and the move-back fails because a new lock exists), that holder's own unlock can remove the new holder's lock. The direct delete is fixed; this path needs the same three-run window plus the old holder finishing inside it. Fix if you want it closed: make unlock check the pid file as unlock_if_held does.
  • scripts/offload-review.sh:136 — OFFLOAD_RULES_DIR moves only the removal path. SKILL.md still tells the caller to create the rules file at /tmp/offload-review-pr<N>-rules.md. A real run with OFFLOAD_RULES_DIR set would not find the file at cleanup. The default matches, and the header says the knob is for the removal folder, so this is a note, not a defect.

What I checked

  • Last review: round 1, 15d7e8b, 2026-11-25T20:00:06Z
  • New commits read: 2 — 6e85ec7 (stop the fetch from touching the shared origin ref), 9fbe52b (read the lock owner pid in the same shell in the exit trap)
  • Read in full: 2 reviews, 2 comments, 0 inline comments (from the three files)
  • New items since my last review: the 2 commits above; the author's comment at 20:02:20 (the fix list, checked item by item in the code); the author's comment at 20:04:34 (the correction about commit 6e85ec7 breaking test (e) on bash 5 — I verified the fix: unlock_if_held now expands BASHPID directly, with no command substitution, which was the bug). Reviewer 2's round-1 review (19:58:30) is older than my last review; I read it in full now and checked every note's resolution above.
  • The full diff of both commits, and each changed file around the changes: lib.sh, offload-review.sh, SKILL.md, offload-review_test.sh.
  • Test (f) traced against the repo state that test (a) leaves: origin main at "one", the lock created empty, before read after the tracking ref is set back one commit, so any shared-ref write would show. Both the assertion and the control match my probes.
  • The bash-3.2 compatibility of the new code: ${BASHPID:-$$} under set -u probed on /bin/bash 3.2.57; $RANDOM and the local forms exist there; bash -n passes on all three files under both bash 5 and /bin/bash 3.2.57.
  • The --refmap= fix itself, with the probes described in item 1.
  • Repo gates: still tooling-only, so no behavior-change note and no data-dependence row. Both commits carry Signed-off-by and Assisted-By.
  • I did not run the repo's tests (live tests not approved). The author reports they pass with /bin/bash 3.2.57 and the default bash; my check is reading plus probes only.

@amiddavid

Copy link
Copy Markdown
Collaborator Author

Local tests: waived (owner rule)

@amiddavid
amiddavid merged commit 41152b6 into main Nov 25, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Nov 25, 2026
amiddavid added a commit that referenced this pull request Nov 26, 2026
- unlock removes the lock only when the pid file holds this
  process's pid. It replaces unlock_if_held.
- An empty pid file in lock_take_stale means "not yet written",
  not "dead". The 60 s age rule applies.
- The script refuses to run on bash older than 4, with a clear
  message. Bash 3.2 has no BASHPID, so a subshell cannot be told
  from the script.
- Test (d) checks that --cleanup removes the scratch rules file.
- SKILL.md names $OFFLOAD_RULES_DIR as the rules file folder.

Refs #1436

Signed-off-by: DAVID AMID <[email protected]>
Assisted-By: Claude Opus 5.5
amiddavid added a commit that referenced this pull request Nov 26, 2026
Close the 4 small gaps in the offload-review lock code that the #1434
reviews found.

- unlock removes the lock only when its pid file holds this process's pid.
- An empty pid file means "not written yet", not "dead". lock_orphan keeps a
  young orphan and removes one that is 60 s or older, or whose holder is dead.
- offload-review.sh needs bash 4 or newer. On bash 3 it stops with a message
  that names brew install bash. On bash 3.2 a subshell reports the script's
  pid, so the lock cannot tell its holders apart.
- Test (d) checks that the scratch rules file is gone after --cleanup.
- SKILL.md names $OFFLOAD_RULES_DIR (default /tmp).

Refs #1436

Signed-off-by: DAVID AMID <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant