Skip to content

fix(hooks): slot wait keys on loop iteration, not the SECONDS clock (#21225) - #21229

Merged
mrveiss merged 1 commit into
mainfrom
issue-21225-slot-wait-flag
Nov 9, 2026
Merged

mrveiss merged 1 commit into
mainfrom
issue-21225-slot-wait-flag

Conversation

@mrveiss

@mrveiss mrveiss commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Thinking Path

machine_slot_wait decided "did I wait?" with [ "$SECONDS" != "$start" ]. SECONDS is an integer clock, so a slot taken on the first attempt counted as a wait whenever a second boundary passed, and the hook made an extra network call (push_marker_set). A wait is an iteration of the loop, so the loop records that directly.

What Changed

  • tools/git-hooks/pre-push: machine_slot_wait gets a waited flag set before the sleep; the "waited" log and marker renewal key on it. The only other SECONDS uses in the hook (next, the periodic "queued" report) are reporting intervals, not wait decisions; no other site in the hook or its helpers.
  • repo_tests/push_marker_20260_test.py: two tests, the first-attempt take across a boundary (stub machine_slot_take moves SECONDS on) sets no marker, and a control with the old clock comparison that does set one.

Verification

pytest repo_tests/push_marker_20260_test.py: 12 passed (includes test_queueing_renews_the_marker and the new pair). bash -n on the hook is clean; shellcheck is not installed locally.

Risks

None identified. A real wait still sets waited=1 before sleeping.

Model Used

Claude Sonnet 5.5 (claude-sonnet-5-5)

Issue Link

Closes #21225

Changelog fragment

  • N/A (internal change)

@mrveiss mrveiss added bug Something isn't working infrastructure phase:M1.7 Docker docs and the docs close-out labels Nov 8, 2026
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 15161d7 and e6e450e.

Files selected for processing: 2

  • repo_tests/push_marker_20260_test.py
  • tools/git-hooks/pre-push
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Notice: 29 open PRs — past the runaway threshold (25)

This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.

This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.

Currently open:

If the queue is draining normally, ignore this. Otherwise:

  1. Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
  2. Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
  3. Look for a loop opening near-identical PRs

Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No new hardcoded values of either class — ssot and other both block.

Known backlog in pipeline-scripts/hardcoded_values_baseline.txt is suppressed and tracked in #14371.

@mrveiss

mrveiss commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

Verdict: APPROVE

Review of head e6e450e.

Severity File:line Finding Fix
none tools/git-hooks/pre-push (machine_slot_wait) waited=1 sits after the whole if/elif/else, so both waiting branches (load high, slot held) reach it before sleep; the take-succeeds branch returns before it on the first attempt. A real wait still reaches the log/push_marker_set renewal on the take that follows. none
info repo_tests/push_marker_20260_test.py (new tests) Pinned boundary test advances SECONDS inside a stubbed machine_slot_take on the first attempt and expects no network call. The contrast test swaps the guard back to the clock comparison and asserts the marker ref appears, so it fails if the replace stops matching. The existing wait-renews-marker test is untouched and still covers the real wait. none
low (non-blocking) pre-push, log "waited $((SECONDS - start))s" Still reads the clock, which is fine for a message. none

No hardcoded values or reuse issues introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working infrastructure phase:M1.7 Docker docs and the docs close-out

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(hooks): machine_slot_wait treats a first-try slot as a wait when SECONDS ticks, so the no-wait contrast test flakes

1 participant