[47030] Duplicate Execution of Service Task "Send Email" After Boundary Timer#8676
Merged
[47030] Duplicate Execution of Service Task "Send Email" After Boundary Timer#8676
Conversation
- Introduced atomic claiming mechanism in TaskSchedulerManager to prevent duplicate task executions. - Added CLAIM_TIMEOUT_MINUTES constant to define the timeout for stale claimed tasks. - Implemented releaseStaleClaimedTasks method to release tasks that have been claimed for too long. - Refactored scheduleTasks method to utilize the new atomic claim logic. - Updated ScheduledTask model to include claimed_by and claimed_at fields. - Created migration to add claimed fields to the scheduled_tasks table. - Added tests to ensure atomic claim functionality and stale claim release behavior.
caleeli
reviewed
Jan 13, 2026
Contributor
caleeli
left a comment
There was a problem hiding this comment.
@marcoAntonioNina Laravel already have a feature to prevent overlapping, could you consider to use it to prevent backward compatibility problems: https://laravel.com/docs/12.x/scheduling#preventing-task-overlaps
- Updated the bpmn:timer command in Kernel.php to prevent overlapping executions by adding the withoutOverlapping method with a 5-minute timeout.
|
QA server K8S was successfully deployed https://ci-5f82585a9c.engk8s.processmaker.net |
caleeli
reviewed
Jan 15, 2026
caleeli
reviewed
Jan 15, 2026
caleeli
reviewed
Jan 15, 2026
…r overlap in app.php.
|
QA server K8S was successfully deployed https://ci-5f82585a9c.engk8s.processmaker.net |
|
caleeli
approved these changes
Jan 21, 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.





Issue & Reproduction Steps
When you have a boundary timer and an email sending configured, the scheduler for some reason starts to duplicate the sendings either because of a delay or because some other task is doing it.
This pull request attempts to prevent another task or the scheduler itself from resending the email.
Solution
How to Test
The process should successfully execute email sending.
Ideally, you should test with a large number of configured ScheduleTasks.
Related Tickets & Packages
Code Review Checklist
ci:deploy