Skip to content

Wait for server-side lease release in test handoffs - #326

Merged
SaladDay merged 1 commit into
mainfrom
codex/lease-close-handoff
Sep 30, 2026
Merged

SaladDay merged 1 commit into
mainfrom
codex/lease-close-handoff

Conversation

@SaladDay

@SaladDay SaladDay commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Store restart tests can acquire a successor lease before PostgreSQL has released the previous session's advisory lock. Lease.Close waits for client cleanup, as documented; it does not acknowledge server-side lock release.

Move the existing owner-specific release observer into shared pgtest support and use it at the internal Store tests that immediately transfer ownership. Existing Worker handoff tests use the same helper. Observation is bounded, rejects query errors and never retries lease acquisition. Production lease behavior and deadlines are unchanged.

Validation:

  • With a test-only transport overlay delaying server disconnect by 250 ms, the baseline failed at the reported activity test line in all 3 attempts; the updated test passed 10 attempts under the same fault.
  • Ordinary baseline repetitions did not reproduce in 100 attempts, confirming the need to expose the short release window.
  • Related Store handoff and Worker restart tests passed 5 repetitions with the race detector; pgtest and the complete pgunit suite passed.
  • A fresh independent blind review found no issues. The reviewer independently passed the reported test and related handoff tests 10 times, plus lease exclusion and cancelled-connection cleanup tests 3 times against PostgreSQL.
  • All selected CI checks passed on 776a9414f2d1eaf2ee01eec94a40c29791650b10: backend, API acceptance, hygiene and the required check (run 36757020221). Temporary PostgreSQL containers, volumes and remote test files were removed.

This is separate from the CI architecture changes in #324.

@SaladDay
SaladDay marked this pull request as ready for review September 30, 2026 18:15
@SaladDay
SaladDay merged commit 3870bae into main Sep 30, 2026
12 checks passed
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.

1 participant