Skip to content
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

Background Processes - Draft 1 #171

Merged
merged 4 commits into from
Aug 1, 2019
Merged

Conversation

knowj
Copy link
Contributor

@knowj knowj commented May 29, 2019

Problem

The cron is one of the most business critical components of Magento, offloading resource
intensive tasks from the user request into the backend and allowing scheduling long running
processes.

The business critical element of the cron needs better supporting in the foundation of the module and
supporting documentation giving better control to developers, technology providers and eCommerce managers.

Solution

Review the current implementation of the cron and how it can be re-built to better facilitate business critical processes, increase visibility and control

Requested Reviewers

@buskamuza @nuzil

@magento-cicd2
Copy link

magento-cicd2 commented May 29, 2019

CLA assistant check
All committers have signed the CLA.

@knowj knowj mentioned this pull request May 29, 2019
@hostep
Copy link
Contributor

hostep commented May 30, 2019

This is just FYI, around point number 2:

Not a lot of people are aware of this I think, but Magento has been shipping with a module dotmailer/dotmailer-magento2-extension out of the box since Magento 2.2.4 I believe, which adds some visibility to cron runs via Reports => Customer Engagement => Cron Tasks
It's not really the responsibility of this module to have a feature like that, but since Magento core is missing such a feature, I think they added it for their own support needs.

So if a similar feature like this gets introduced in Magento core, I think someone should talk to those developers to remove that feature from their module, as it would no longer have any purpose anymore.

As to that there isn't an AOE scheduler available for Magento 2, that's not really true, because there are a bunch of open source and commercial modules which seems to more or less replicate it.
The best one i've seen so far is https://github.com/Ethan3600/magento2-CronjobManager, but I haven't played around with it a lot since I only discovered it like 2 weeks ago.
But it has this nice extra feature where it adds an extra column to the cron_schedule database to keep track of the process id's of running jobs. And if a job still has the state running and the process id no longer exists on the server, it cleans it up. I'm not sure how well this works on multiple webservers though, it might only work when you have a single node.
This last thing is really a feature Magento core is missing. We recently still saw this behavior happening on a Magento 2.2.6 shop where a certain job stayed in running and then a bunch of pending jobs kept piling up and nothing ever happened to clean this up automatically. Currently you can only fix this manually with some SQL statements directly in the database in the current state of Magento unfortunately.

Anyway, I'm looking forward to seeing a more stable cron system in Magento. The stability was much improved in Magento 2.2.5 with the locking mechanism in mysql, but there are still some cases which aren't covered yet.

@buskamuza
Copy link
Contributor

@piotrekkaminski , can you please look at the proposal from product side?

@piotrekkaminski
Copy link

couple other requirements gathered over the years:

  • visualization
  • reschedule jobs to avoid promotions
  • be careful not to have jobs overlap (especially as they get longer with more products being added) - leads to DB locks, also sequencing jobs in a way they do not work on the same thing.

@knowj knowj changed the title Cron proposal - Draft 1 Background Processes - Draft 1 Jul 18, 2019
@buskamuza buskamuza added the pending response Waiting for additional information label Jul 31, 2019
John Knowles and others added 2 commits August 1, 2019 08:38
…posal.md


Remove duplicate 'to'

Co-Authored-By: Alex Paliarush <paliarus@adobe.com>
@buskamuza buskamuza removed the pending response Waiting for additional information label Aug 1, 2019
@buskamuza buskamuza merged commit ba36873 into magento:master Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.