Skip to content

Waiter schedule forced and traced; field-level assertions (v0.3.2) - #27

Merged
flyingrobots merged 1 commit into
mainfrom
fix/waiter-schedule-and-field-asserts
Sep 16, 2026
Merged

flyingrobots merged 1 commit into
mainfrom
fix/waiter-schedule-and-field-asserts

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Sep 16, 2026

Copy link
Copy Markdown
Member

Closes #23 and #15. Forcing the schedule found and fixed five-reads-per-retry after an invalidation. 294 checks (the commit message says 300; this number is the run). Merging tags v0.3.2.

… field-level test assertions (v0.3.2)

#23: a second gate (GIT_LOCKS_PAUSE_AFTER_READ) and a read trace
(GIT_LOCKS_TRACE) force the waiter-with-stale-read schedule for both
sem acquire --wait and with --wait, asserting exactly two reads. Forcing it
found that after an invalidation each $(…) in the retry took its own
snapshot, five per attempt; every read phase now loads once in the parent.

#15: assertions on parsed fields in any key order; 51 substring checks
converted. 300 checks.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d1209746-5cf6-42c2-ab12-2af2b81d5753

📥 Commits

Reviewing files that changed from the base of the PR and between bf8bb27 and 8863d28.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • bin/git-locks
  • test/test.sh

📝 Summary

Summary by CodeRabbit

  • Bug Fixes

    • Improved waiting operations so they correctly detect and proceed after a concurrent release.
    • Limited stale and fresh state reads during waiting, improving consistency and reducing unnecessary retries.
  • Chores

    • Updated the application version to 0.3.2.
  • Tests

    • Expanded coverage for waiting behavior and concurrent release scenarios.
    • Strengthened validation of structured command output.

Walkthrough

The release adds bounded snapshot reads, explicit refreshes across retry and read paths, read tracing and gate hooks, structured JSON assertions, and deterministic waiter tests for sem acquire --wait and with --wait.

Changes

Waiter snapshot handling

Layer / File(s) Summary
Read tracing and gating hooks
bin/git-locks
Adds GIT_LOCKS_TRACE, GIT_LOCKS_PAUSE_AFTER_READ, and the shared test_gate helper. The version changes to 0.3.2.
Explicit snapshot refreshes
bin/git-locks
Retry loops explicitly call snapshot, and snapshot-consuming functions call ensure_snapshot so related reads share one fresh snapshot.
Structured assertions and forced waiter tests
test/test.sh, CHANGELOG.md
Adds jval and jfields, converts JSON checks to parsed-field assertions, and tests stale-read schedules for both waiter modes. The changelog records the release changes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Waiter as sem acquire --wait or with --wait
  participant Snapshot as snapshot
  participant Release as concurrent release
  participant Store as lock store
  Waiter->>Snapshot: read initial state
  Release->>Store: release held state
  Waiter->>Snapshot: read fresh state on next attempt
  Waiter->>Store: acquire and continue
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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

A rabbit reads the snapshot twice
The stale gate opens without a dice
Fields line up in JSON light
Waiters acquire on the next try
The lock store keeps its state just right

Comment @coderabbitai help to get the list of available commands.

@flyingrobots
flyingrobots merged commit 598e060 into main Sep 16, 2026
2 of 3 checks passed
@flyingrobots
flyingrobots deleted the fix/waiter-schedule-and-field-asserts branch September 16, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Third forced schedule missing: a waiter that retains stale state across a release

1 participant