Merged
Conversation
afck
approved these changes
Feb 12, 2026
ma2bd
reviewed
Feb 12, 2026
| } | ||
| // Signal that this batch is done so the main loop can process | ||
| // the next batch for this application. | ||
| let _ = sender.send(TaskMessage::BatchComplete { application_id }); |
Merged
ndr-ds
added a commit
that referenced
this pull request
Feb 13, 2026
## Motivation Missed a `let _ = ` on #5431 ## Proposal Remove it ## Test Plan CI
ndr-ds
added a commit
that referenced
this pull request
Feb 17, 2026
## Motivation Missed a `let _ = ` on #5431 ## Proposal Remove it ## Test Plan CI
ma2bd
reviewed
Feb 19, 2026
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.
Motivation
The task processor can call
process_actionsmultiple times while a previous batch's tasks are still in-flight.When there's a backlog (
schedule.startfar in the past), the deadline timer firesimmediately because the next event is also in the past. The
last_requested_callbacksguard passes, andnext_actionsreads stale on-chain state (schedule.start hasn't advanced yet), generating overlapping timestamps.When both batches are eventually submitted as blocks, batch 2's stale timestamps don't
match the now-advanced
schedule.start, causing:Proposal
Introduce an
in_flight_apps: BTreeSet<ApplicationId>guard in the task processor. When a batch of tasks is spawnedfor an application, the app is marked as in-flight and subsequent
process_actionscalls skip it. A newTaskMessageenum replaces the raw(ApplicationId, TaskOutcome)channel, adding aBatchCompletevariant that thespawned task sends after all outcomes. On
BatchComplete, the guard is cleared andprocess_actionsisre-triggered for that app so it reads freshly-updated on-chain state.
Test Plan