Closed hostep closed 4 months ago
Hi @hostep. Thank you for your report. To speed up processing of this issue, 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:
@magento give me 2.4-develop instance
- upcoming 2.4.x release@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: 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.
@magento I am working on this
Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Area: XXXXX
label to the ticket, indicating the functional areas it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Hi @hostep
Thanks for reporting and collaboration.
It is not advisable to disable MSI modules.
As per the adobe dev docs, Disabling the Inventory Management modules can cause an unstable system and result in various issues.
Please refer the below devdocs for more information :
https://experienceleague.adobe.com/docs/commerce-admin/inventory/get-started/install-update.html
Thanks
@engcom-Dash: that's not the point, this was just the easiest way I could find to demonstrate the problem 😉
This will most likely happen in the real world where you had a third party module installed (which contains a cronjob) for a couple of months and then decide to remove it again. Afterwards, you'll still find entries from that no longer existing module in your cron_schedule
table and that is polluting the database.
Please re-read the description and if it's not clear, try to pull in one of your colleagues and see if they understand it better. And if it's still not clear, then let me know what's not clear so I can try to describe it better.
Hi @hostep
Thanks for reporting and collaboration.
Verified the issue in magento 2.4 dev instance and the issue is reproducible.
After disabling MSI modules , seeing the inventory_in_store_pickup_sales_send_order_notified_emails in the table with status success when we run the cron job and checked in the cron_schedule table.
Please refer the attached screenshots.
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-10910 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Dash. Thank you for verifying the issue.
Issue Available: @engcom-Dash, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
:x: You don't have permission to export this issue.
Preconditions and environment
Steps to reproduce
Explanation below how to trigger this with a cronjob from inside core Magento. But the most likely cases will come from 3rd party modules containing cronjobs, that were installed for a while and then removed again.
cron_schedule
table and notice that the jobinventory_in_store_pickup_sales_send_order_notified_emails
is mentioned many times with statussuccess
app/etc/config.php
and runbin/magento setup:upgrade
cron_schedule
table againExpected result
It's expected that all jobs that were successful and having run more than 60 minutes ago are removed from the
cron_schedule
table.Actual result
See that there are still jobs
inventory_in_store_pickup_sales_send_order_notified_emails
in the table with status success and being older then 60 minutes. Those don't get cleaned up because the MSI modules are no longer active and callinggetJobs()
over here doesn't return jobs from inactive (or removed) modules.Additional information
Ideally, the cronjob cleanup should also figure out which jobs are in the
cron_schedule
table that are no longer found in the system and clean those up as well. Or maybe this can be added in the existing Recurring data script that exists in the Magento_Cron module, as then it doesn't need to be checked every minute when the cron actually runs. Since removing and disabling modules requires abin/magento setup:upgrade
call anyway, it might be a good idea to only then check for outdated entries in that table and remove them...And since the
cron_schedule
table receives a lot of queries the entire day, it's beneficial to performance that it contains as few rows as possible. Old data should be cleaned up automatically.I found this in a shop where we have hundreds of entries from 2021 in the
cron_schedule
table for jobs that for a long time no longer existed.Release note
No response
Triage and priority