recover the review hook lock after a killed delivery

Open Beginner friendly
#158 1 comment 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, shell
Domain
devtools

Research direction

Open scripts/review-hook.sh at b96823b and find the mkdir acquisition of $RUNNER_TEMP/injected-deliveries.lock, the until mkdir ...; do sleep 0.01; done loop, and the EXIT trap that removes it. Reproduce first by creating the lock directory and running timeout 1 bash scripts/review-hook.sh with a Stop payload; it should exit 124 with no output. Done means the wait is bounded and a stale lock (dead owner PID or old age) is reclaimed while deliveries stay serialized, verified by re-running that repro and a normal two-hook sequence.

Written by the indexing model from the issue text.

Description

scripts/review-hook.sh at b96823b73697d1ff09fa11bf63b85b6cebe71c8d acquires $RUNNER_TEMP/injected-deliveries.lock with mkdir and waits forever. The EXIT trap removes it on a normal exit, but a hook killed by a timeout, SIGTERM, OOM, or sandbox cancellation leaves the directory behind. Every later hook then spins in until mkdir ...; do sleep 0.01; done, so the review stops receiving activity and blocks until its deadline.

Repro: create $RUNNER_TEMP/injected-deliveries.lock, then run timeout 1 bash scripts/review-hook.sh with a Stop payload; it exits 124 and produces no output. A hook killed after acquiring the lock leaves the same state.

A bounded wait with stale-lock recovery (owner PID/age or a lock released on process death) would avoid the permanent block while keeping delivery serialized.

Seen while pinning the hosted runner in promplate/platform 1658c905fa367e301a1748109f327feba08322ed.

Dominant language
TypeScript
Stars
0
Forks
0
Avg merge
6h
Merged PRs (30d)
118

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from promplate/code-review

All issues in promplate/code-review

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.