Repository navigation
Fix lease renewal and preserve claimed fences - #89
Merged
Merged
Conversation
Apply the parity repair for independently reported lease defects. Renew between drain turns when due, without relying on the renewal thread, and keep the activation fence while a message claim remains. Before the fix, regressions reported an expired lease during draining and a cleared expiry with an outstanding claim. Confirm renewal, recovery with max_attempts: 1, and replacement-owner fencing on SQLite, PostgreSQL, mysql2, and Trilogy. Preserve existing cross-pass renewal and NULL-expiry claim recovery behavior.
|
Docs7 for cardmagic/solid-objects-ruby
Commit |
|
Align the gem version and lockfile and date the activation lease release notes. Review the consumer guides and validate the complete suite and built gem before preparing the release for tagging after merge. See #89
Owner
Author
|
@greptileai Please review current head 6db0de8, which prepares version 0.17.4. The gem version, lockfile, and dated changelog match. Consumer guides were reviewed against the release. Full bundle exec rake validation passed (926 tests, 3725 assertions, no failures/errors), and gem build produced version 0.17.4. No tag or publication has been made. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two activation-lease defects were independently found and reported, prompting a parity audit of the Ruby runtime. Ruby already renews retained activations across worker passes and can recover claims after a cleared expiry, but a drain pass still relied on the renewal thread and Lease#release could clear a fence while its message claim remained.
Renew between turns when due, preserving the existing renewal thread for long handlers. Do not release a matching activation while it has a claimed message; the next pass acquires a new generation and recovers the expired turn. Keep all existing owner, token, generation, and expiry checks. Avoid an extra database-clock read before the first turn, preserving the synchronous invocation query-count contract.
No schema, setting, default, or public API changes. Prepares version 0.17.4 in lib/solid_objects/version.rb and Gemfile.lock, with dated changelog notes. Tag v0.17.4 after merging; no tag or publication is included. Reclaiming continues to increment attempt_count from 1 to 2; the recovered message can complete with max_attempts: 1. Lease loss alone does not create a dead letter, and later messages stay behind the recovered message. Real handler errors retain the existing attempt-limit behavior. Existing Ruby worker.error logging and recovery.reclaimed instrumentation remain unchanged.
Regression evidence, collected before the fix and again with the fix removed:
The tests advance the adapter clock deterministically; the draining test uses the real Activation without starting a renewal thread. The takeover runs the replacement worker on another thread so the original actor's application-write guard does not apply to that worker.
Validation:
Release preparation: reviewed docs/virtual-actors.md and docs/agents.md against the release; no requirement or guarantee corrections needed. Re-ran bundle exec rake TESTOPTS=--seed=18761 (926 tests, 3725 assertions, zero failures/errors, 28 conditional skips, all static/security gates passed) and gem build solid_objects.gemspec (version 0.17.4).
Five new tests, 211 assertions, passed on SQLite, PostgreSQL, mysql2, and Trilogy; zero skips in these focused runs.
bundle exec rake TESTOPTS=--seed=18761: 926 tests / 3725 assertions, zero failures or errors, 28 conditional skips; Standard, RuboCop, RBS generation/validation, Steep, and Brakeman passed, with zero security warnings.
An existing SQLite timeout test also raises SQLite3::CantOpenException while reopening WAL mode on the unchanged baseline; its independent reproduction is recorded in the local review evidence.
Inspected effect executor, reminder scheduler, and broadcast executor: no cached actor renewal deadline or activation-expiry recovery predicate. Their claims use item state and process/claim staleness, so these two patterns require no changes there.
JavaScript parity: cardmagic/solid-objects-js#72. The Ruby changelog and roadmap are updated.