Repository navigation
Fix lease renewal and expired-claim recovery - #72
Conversation
Repair two independently reported activation-lease defects. Preserve the renewal deadline across turns and check it before the next claim. Keep the activation fence while a claimed message remains so expired-turn recovery can run in the next pass. Regressions failed before the fix with activation.lost, a six-turn pass instead of ten, and a recovery pass that processed zero messages. Verify renewal, same-worker recovery with maxAttempts: 1, and replacement-owner fencing on SQLite, PostgreSQL, and MySQL.
|
Docs7 for cardmagic/solid-objects-js
Commit |
|
Reuse and reset the activation lease tables so repeated server database runs do not accumulate tables or retain messages. Include these tests in the PostgreSQL and MySQL CI commands to exercise both adapters. See #72
|
@greptileai Please review the latest commit 76f5755, including the test cleanup fix for the reported table accumulation and the added PostgreSQL/MySQL CI coverage. All local checks passed; please reassess the current head. |
Shared CI scheduling can legitimately expire a 200 ms server lease between passes. Advance the database and worker clocks together while holding timers so the regression depends only on the intended turn gaps. Keep the required real synchronous timing regression on SQLite. Verify all three defect regressions still fail on the original worker and repository against both PostgreSQL and MySQL, then pass with the fixes restored. See #72
|
@greptileai Please review the latest commit 3797354. The earlier table-cleanup finding is resolved. Adding the lease tests to server CI exposed a wall-clock scheduling failure (generation advanced between passes, with no activation loss); server tests now advance the database and worker clocks together while keeping timers paused. SQLite still runs the required real synchronous waits with a 200 ms lease. Confirmed that the three defect tests fail against the original worker/repository on both PostgreSQL and MySQL and all four pass with the fixes restored. Full local default suite, adapter suites, formatting, and checks pass. Please reassess the current head. |
Replace the nested adapter ternary with separate checks to follow the repository style without changing database selection. See #72
|
@greptileai Please review current head 22c4075. Both reported findings are addressed: stable test tables with cleanup and adapter selection using early returns. Commit 3797354 also controls server test clocks to remove CI scheduling sensitivity, while SQLite retains the real-time synchronous regression. Please reassess the current head. |
Align package and runtime versions, date the release notes, and track the matching Ruby 0.17.4 activation lease fixes in the parity ledger. Prepare the release for tagging after the pull request is merged. See #72
|
@greptileai Please review current head d096204, which prepares version 0.17.7. Package and runtime versions match, the changelog is dated, and the parity ledger targets the accompanying Ruby 0.17.4. Full tests, checks, formatting, package build/install smoke tests, and release-note generation pass locally. No tag or publication has been made. |
The 34-turn regression can exceed Vitest default five-second timeout on shared MySQL CI runners. Allow fifteen seconds for test execution while keeping the 200 ms lease, 50 ms renewal, and all assertions. See #72
|
@greptileai Please review current head 7e98084. The 0.17.7 metadata is unchanged from the reviewed preparation commit. CI exposed the default five-second test timeout in the 34-turn server regression, so it now has a fifteen-second execution budget. The 200 ms lease, 50 ms renewal, and every correctness assertion are unchanged. Full local tests, MySQL adapter suite, checks, and formatting pass. |
Two activation-lease defects were independently found and reported. Continuous short turns kept postponing the cached renewal deadline without extending the stored lease; after a turn lost that lease, release cleared its expiry while leaving its claimed message in place, hiding it from recovery.
Preserve the renewal deadline across turns and check it inside the pass before the next claim. Keep the owner, token, generation, and expiry when any message claim remains, so the existing fenced recovery transaction can reclaim it on the next pass. Stale owners still cannot release a replacement activation.
No schema, setting, default, or public API changes. Prepares version 0.17.7 in package.json and src/version.ts, with dated changelog notes and the parity ledger targeting Ruby 0.17.4. Tag v0.17.7 after merging; no tag or publication is included. A pass limit of one is no longer required to avoid renewal starvation. An expired turn commits no durable state; its replacement turn runs before later messages. Reclaiming increments attempt_count from 1 to 2 and succeeds with maxAttempts: 1. Lease loss alone emits activation.lost, then recovery.reclaimed on reclaim, without message.failed or dead_letter.created; an actual handler error still uses the existing attempt limit. Handlers can execute again, so external side effects still require idempotency.
Regression evidence, collected before the fix and again with the fix removed:
Validation:
Ruby parity: cardmagic/solid-objects-ruby#89. The parity ledger and changelog are updated.