-
Notifications
You must be signed in to change notification settings - Fork 0
docs: state that a reminder is one alarm per actor and name #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When SQLite retries the fenced transaction after a later database write raises a busy or deadline error, this line appends the retried payloads to the same
moved_remindersarray that retained the rolled-back attempt's payloads, causing duplicate or stalesolid_objects.reminder.replacedevents after the successful commit.Prompt To Fix With AI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed in 0d3b35f. The adapter retries the whole
fenced_transactionblock on a busy database, and bothenqueued_effectsandmoved_reminderswere declared outside it, so an abandoned attempt left its entries for the committed attempt to report again.Worth noting the effect list has had this flaw since it was introduced; the reminder list inherited it. Both are now cleared at the top of each attempt, so every attempt starts from empty.
I could not build a faithful test for this, and I would rather say so than ship one that passes for the wrong reason. The suite runs inside a transactional test, so an inner rollback is a no-op: a stub that reruns the block leaves the first attempt committed, which turns into a message-level retry and reports two effects for reasons unrelated to array accumulation. I wrote that test, watched it fail, then established it was failing for the wrong cause and deleted it. Forcing a genuine adapter-level busy retry needs contention this harness cannot produce deterministically.
What I did verify: the retry path is real (
DatabaseAdapters::Sqlite#transactionwrapssuperinwith_busy_retry, which re-runs the caller block), the fix is twoclearcalls at the top of the attempt, and the full gate is green.bundle exec rake: 388 runs, 1299 assertions, 0 failures, 0 errors, 14 skips.@greptileai review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix is correct and minimal. The two
.clearcalls at the top of thefenced_transactionblock are exactly the right shape — both lists were declared outside the block, so every retry attempt was accumulating on top of whatever the previous attempt left behind. Moving initialization inside the block would have worked too, but.clearkeeps the variable in the outer scope where the reporting loop needs it after the transaction commits, which is the right tradeoff.The symmetry between
enqueued_effectsandmoved_remindersis also now explicit, which is good: the same structural flaw existed in both, and both are now fixed by the same pattern.On the missing test: the explanation in the commit message is honest and precise. A transactional test harness that absorbs inner rollbacks cannot exercise the retry path faithfully, and a stub that reruns the block without a genuine rollback measures message-level retry semantics instead. Shipping a test that passes for a different reason would be worse than no test. The commit message records the reasoning clearly enough that a future contributor working with a production-like setup (or an integration test environment that allows real contention) knows exactly what to reach for.
The fix is clean. No concerns.