Closed
Description
I noticed that when I start a cron that's already running it will run again. For example: I have a task that takes 15 minutes, but the cron executes it's every 5 minutes. In the database the cron gets the status running
and the other scheduled jobs have pending
. But after 5 minutes, the other job (with the same code) also starts to run. So now I have the same job running twice!
Preconditions
- Magento 2.1.7
Steps to reproduce
- Create a cron that takes a while (for example, sleep 15 minutes)
- Schedule it to run every 5 minutes
Expected result
The other jobs should wait for the first job to complete, even though they are scheduled to run every 5 minutes.
Actual result
The new job starts, ignoring the fact that it's already running...
I'm not sure if this is intended behavior or a bug. Am I expected to create my own lock / flag for this?
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.2 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release