-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Cron schedule is being duplicated #21380
Comments
Hi @udovicic. Thank you for your report.
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
For more details, please, review the Magento Contributor Assistant documentation. @udovicic do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
|
Hi @engcom-backlog-nazar. Thank you for working on this issue.
|
Hi @udovicic this is expected behavior, if you have a job that runs every time like * * * * *, magento create a few rows for this job. this is not publicated rows. |
Hi @engcom-backlog-nazar , If you repeat steps 1. - 4. few times, more duplicated rows appear, for an example:
Most of them are the cases that you have mentioned above, but one of the rows that also showed for me is: <job name="magento_newrelicreporting_cron" instance="Magento\NewRelicReporting\Model\Cron" method="runCron">
<schedule>*/2 * * * *</schedule>
</job> Just an example to show, but I do not think that one should be duplicated. |
@udovicic on you screen you have 2 defferent job starting at the same time waths wrong here ? |
@engcom-backlog-nazar That is not correct, if you check the SQL from description, you will notice that first column shows number of occurrences. Meaning that there is only one job |
✅ Confirmed by @engcom-backlog-nazar Issue Available: @engcom-backlog-nazar, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself. |
I can confirm that Magento 2.3.1 creates crazy amounts of duplicated cron tasks, some of them are finished, many are missed, due to duplication. Especially some indexers were not refreshed in Update by Schedule mode. Definitely it should be fixed asap. |
Hi @chickenland. Thank you for working on this issue.
|
The issue here (that I can re-create) is the cron running multiple times in the same minute will schedule for that minute over and over - because it completes the task and then reschedules it. The fix I envisage here would be that instead of checking for pending cron tasks, it checks in all non-exited statuses (ie. pending, running or success) - and schedules based on that. Therefore, overlapping, completing/running cron tasks will not re-schedule completing/running cron tasks. |
Hi @udovicic. Thank you for your report.
The fix will be available with the upcoming 2.3.3 release. |
Hi @udovicic. Thank you for your report.
The fix will be available with the upcoming 2.2.10 release. |
Why this fix is not present on 2.3+ ? It disappears on 2.4.0 |
Preconditions (*)
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition:2.2.7 .
php bin/magento setup:install --base-url="http://www.example.com/" --db-host="db" --db-name="..." --db-user="..." --db-password="..." --admin-firstname="Admin" --admin-lastname="Admin" --admin-email="admin@example.com" --admin-user="admin" --admin-password="..." --language="en_US" --currency="EUR" --timezone="Europe/Zagreb" --use-rewrites="1" --backend-frontname="admin"
. This is actually blank installation, but lets document just in case.Steps to reproduce (*)
SELECT count(*), job_code, scheduled_at FROM `cron_schedule` GROUP BY job_code, scheduled_at ORDER BY `count(*)` DESC
Expected result (*)
Actual result (*)
Note:
This has been reported few times before, but issue has been closed with note that new one should be opened if it still persists.
The text was updated successfully, but these errors were encountered: