-
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
Set process title when running cron job #34186
Set process title when running cron job #34186
Conversation
Hi @fredden. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@fredden: very nice, this sounds super useful! Can you put a screenshot here, of how it looks with
We do occasionally have this situation, it's usually for some demo shops or something like that, never for a real production shop, so there are still valid cases I believe. |
Thanks for your input @hostep. I've added before & after pictures to the main pull request description. I'm still somewhat undecided about what the process title should contain; I'm confident that including the process group & current job name will be helpful. I don't know if there's enough room for a full path too. Perhaps the path should go at the end? |
Looks really useful, but it might introduce backwards incompatibilities, for example, the following code will probably stop working ... If you could somehow try to append the extra info to the original output, it might be better?
But not sure how complicated this would be, not sure if you can fetch the original output using |
Thanks for your feedback, Pieter. Based on this I've updated the pull request to preserve the original command line arguments and add the new information at the end. I've updated the screen-shots in the main description. I'm open to including |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Thanks for the updates! The I would try to stick as close as possible to the original output if possible. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
@fredden ✔️ QA Passed Set process title when running cron job Manual Scenario Steps
|
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
As Functional Tests CE is failing hence moving to |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Description
When managing a busy server, it's helpful to understand what each process is doing. Currently there is no visibility for a systems administrator to see what task the
bin/magento cron:run
process is currently performing. The most information that's available is that some job (or set of jobs) is running within a PHP process that was started via the system task scheduler (read: cron daemon). Because of the way that Magento spawns additional processes for some groups (depending on their configuration) it is possible to sometimes narrow down the list of possible tasks because the group name is listed in the command arguments.This pull request sets the title of the currently-running process to clearly list the group and job names.
Before screen-shot
After screen-shot
Related Pull Requests
None
Manual testing scenarios
bin/magento cron:run
when several long-running tasks are scheduledps
orhtop
on Unix - untested on Windows, but the functionality should work there too)Questions or comments
Should the path to Magento be listed in the process title too? If there are multiple Magento instances on a single server, they should be running under different users. I can't think of a sensible non-development environment where multiple Magento instances run under the same system user.
Contribution checklist
Resolved issues: