Skip to content

Commit

Permalink
do not early return for validated task in synchronous mode (#547)
Browse files Browse the repository at this point in the history
## Describe your changes and provide context
Early returning without re-execution may leave invalid state

## Testing performed to validate your change
  • Loading branch information
codchen authored Oct 30, 2024
1 parent 851b25b commit 02f1c2f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tasks/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,10 @@ func (s *scheduler) executeTask(task *deliverTxTask) {

// in the synchronous case, we only want to re-execute tasks that need re-executing
if s.synchronous {
// if already validated, then this does another validation
// even if already validated, it could become invalid again due to preceeding
// reruns. Make sure previous writes are invalidated before rerunning.
if task.IsStatus(statusValidated) {
s.shouldRerun(task)
if task.IsStatus(statusValidated) {
return
}
s.invalidateTask(task)
}

// waiting transactions may not yet have been reset
Expand Down

0 comments on commit 02f1c2f

Please sign in to comment.