Skip to main content

Module push_lock_clearing

Module push_lock_clearing 

Source
Expand description

The wrapper’s own fetch and push, started after the stale reference locks of their repository are cleared. What: The wrapper’s own fetch and push, run after the reference locks of a killed Git in their repository have been judged and the provably stale ones removed. Why: The commit service pushes unattended, and the reconcile fetch runs inside it, so a lock that a killed Git left blocks them with nobody there to clear it. Clearing before every start also covers every repetition of a push (each repetition starts through here), and nothing is waited for. A failed attempt carries the notice, so the person who reads the failure (or the refusal Git prints and still exits 0 on) finds what was removed, what was left, and the command that clears a lock the wrapper will not remove.

In TS you’d write (pseudocode):

const outcome = clearStaleRefLocks(rootsOfCommand(command), judge);
const attempt = await runBoundedPushOnce(command);
if (attempt.exitCode !== 0) attempt.output += outcome.notice();

Functions§

run_clearing_locks
Run command as run_bounded_push_once does, after the stale reference locks of its repository are cleared by judge.