Problem/Motivation
I'm experiencing an issue with deployments to non-prod Pantheon environments. Specifically this occurs when drush tries to rebuild the cache, it seems to be triggering cron and one of the queue workers is taking 30+ minutes. I debugged this locally and found it was due to the automated_cron module triggering cron jobs in \Drupal\automated_cron\EventSubscriber\AutomatedCron::onTerminate.
The best way around this is to not use automated cron, but trigger cron jobs with drush. Somehow this is not supported on Pantheon. In saying that, I don't think it makes sense for automated_cron to run on CLI. If you have CLI access you can run cron with drush. Cron should not be triggered during deployments.
Steps to reproduce
Proposed resolution
Don't run \Drupal\automated_cron\EventSubscriber\AutomatedCron::onTerminate on CLI
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Issue fork drupal-3576648
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3576648-skip-automated-cron
changes, plain diff MR !14962
Comments
Comment #2
mstrelan commentedCache rebuild now takes 6 seconds instead of 30+ mins
Comment #4
godotislateSomething something kubernetes.
Comment #5
mstrelan commentedAddressed all feedback. Apparently I'm not authorised to run test-only jobs, but I verified this locally.
Comment #6
godotislateI think that's #3576458: [regression] Subsystem and Topics maintainers require access to re-run, trigger, or view tests. But I will run to confirm once the build is done.
Comment #7
godotislateHad to run a manual build myself in order to have it run in the issue fork instead of the parent project, but here's the test only failure: https://git.drupalcode.org/issue/drupal-3576648/-/jobs/8726517
lgtm.
Comment #8
mstrelan commentedThank you! I think this should probably be a bug report, so changing the category. Wouldn't mind a review of the CR, if there are any specific recommendations we should add or if linking to the docs page is sufficient.
Comment #9
godotislateReviewed the CR. It's pretty straightforward, so I think it looks good too.
Comment #10
alexpottCommitted and pushed 1bcdac075aa to main and a54eece3442 to 11.x and 5b3a0c37b5f to 11.3.x. Thanks!