-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Crons parallelization management #35639
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
Comments
Hi @Nuranto. Thank you for your report.
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Same issue on 2.4.3-p2 version |
Hi @Nuranto, Thanks! |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi @engcom-Lima,
Expected behaviour After a 30 minutes, Only one cron process is started/running Actual behaviour After 30 minutes, we have 30 cron processes running, possibly consuming all resources if sleep is being replaced by actual code. |
Hi @Nuranto Thanks for the input, Steps followed to reproduce the issue
Only one process was started and cannot see more that one process running Do let me know if I have missed any steps will reverify again Thanks |
Hello @engcom-Lima You need to set |
Hi @Nuranto, Reverified with again and the issue is reproducible, Hence confirming the issue Thanks |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-6314 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Lima. Thank you for verifying the issue. |
❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-6314 |
Summary (*)
Magento 2.4.4
Crons groups that can be parallelized are launched via the main
cron:run
command. This can be a problem if that process is taking too long.Examples (*)
Use case :
Let's say you have one group
group_example
that haveuse_separate_process
to1
, where there is a jobjob_example
that need to be executed every minutes.Let's also say that the others groups are taking 10min to execute (long reindex, or whatever).
It means that the command
/usr/local/bin/php /var/www/html/bin/magento cron:run --group=group_example --bootstrap=standaloneProcessStarted=1
is run every 10 minutes.Which means
job_example
may not be executing for 10 minutes.(the number "10" minutes is arbitrary for the example, I'm sure sometimes it could be a lot more)
Proposed solution
It would be more safe and logical if the separate processes were not launched by the
cron:run
command.Those parallelization-friendly groups should be added to crontab by
cron:install
directly.Also, other subject but a linked one, we should probably prevent
cron:run
to be launched when another is already running to avoid accumulation risks.cron:run
can be launched withflock
for instance :flock -w 0 /tmp/magento.cron.lock /usr/local/bin/php {magentoRoot}bin/magento cron:run
Of course, we can modify all this manually via
di.xml
, but maybe it should be native.Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.
The text was updated successfully, but these errors were encountered: