-
Notifications
You must be signed in to change notification settings - Fork 49
hotfix: load failed intents on restart & reschedule #1371
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,10 @@ pub trait IntentPersister: Send + Sync + Clone + 'static { | |
| &self, | ||
| min_created_at: u64, | ||
| ) -> CommitPersistResult<Vec<CommitStatusRow>>; | ||
| fn get_failed_commit_statuses( | ||
| &self, | ||
| min_created_at: u64, | ||
| ) -> CommitPersistResult<Vec<CommitStatusRow>>; | ||
| fn get_commit_status_by_message( | ||
| &self, | ||
| message_id: u64, | ||
|
|
@@ -257,6 +261,16 @@ impl IntentPersister for IntentPersisterImpl { | |
| .get_pending_commit_statuses(min_created_at) | ||
| } | ||
|
|
||
| fn get_failed_commit_statuses( | ||
| &self, | ||
| min_created_at: u64, | ||
| ) -> CommitPersistResult<Vec<CommitStatusRow>> { | ||
| self.commits_db | ||
| .lock() | ||
| .expect(POISONED_MUTEX_MSG) | ||
| .get_failed_commit_statuses(min_created_at) | ||
| } | ||
|
Comment on lines
+264
to
+272
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Avoid panicking on the DB mutex in this new method. Line 270 uses 🤖 Prompt for AI AgentsSource: Path instructions |
||
|
|
||
| fn get_commit_status_by_message( | ||
| &self, | ||
| message_id: u64, | ||
|
|
@@ -415,6 +429,18 @@ impl<T: IntentPersister> IntentPersister for Option<T> { | |
| } | ||
| } | ||
|
|
||
| fn get_failed_commit_statuses( | ||
| &self, | ||
| min_created_at: u64, | ||
| ) -> CommitPersistResult<Vec<CommitStatusRow>> { | ||
| match self { | ||
| Some(persister) => { | ||
| persister.get_failed_commit_statuses(min_created_at) | ||
| } | ||
| None => Ok(Vec::new()), | ||
| } | ||
| } | ||
|
|
||
| fn get_commit_status_by_message( | ||
| &self, | ||
| message_id: u64, | ||
|
|
||
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.
🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift
Don't union independently filtered recovery rows.
Line 184 and Line 185 can recover a partial bundle. If one
message_idhas bothPendingandFailed*rows with differentcreated_atvalues, one query can include it while the other excludes it, androws_to_scheduled_intent_bundlesthen rebuilds only the surviving subset of accounts. Compute recovery eligibility once across the full recoverable-status set and load all eligible rows together.🤖 Prompt for AI Agents