0

Magento 2 v2.3.1. CRON causing intermittent Deadlock for cron_schedule

we installed vanilla M2 some extensions. But default CRON is leading to deadlock warnings. Maybe not critical but should not happen. Also the solution found elsewhere: truncate the table of course only works temporarily. The error will re-occur. Magento should have some kind of deadlock retry mechanism ...

Question: is there any way to structurally solve this issue?

https://www.cadence-labs.com/2018/09/magento-2-deadlock-retry-module/

In Mysql.php line 589:

  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to   
  get lock; try restarting transaction, query was: DELETE FROM `cron_schedule  
  ` WHERE (status = 'missed') AND (job_code in ('jobs_ecommerce', 'ebizm  
  arts_webhooks', 'jobs_clean_webhooks', 'jobs_clean_batches')) AND  
   (created_at < '2019-04-18 04:06:05')                                        


In Pdo.php line 235:

  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to   
  get lock; try restarting transaction, query was: DELETE FROM `cron_schedule  
  ` WHERE (status = 'missed') AND (job_code in ('jobs_ecommerce', 'ebizm  
  arts_webhooks', 'jobs_clean_webhooks', 'jobs_clean_batches')) AND  
   (created_at < '2019-04-18 04:06:05')                                        


In Pdo.php line 228:

  SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to   
  get lock; try restarting transaction                                         


cron:run [--group GROUP] [--bootstrap BOOTSTRAP]
  • You have to check all the error logs because I think there might be an error in following cron _job like jobs_ecommerce or ebizmarts_webhooks. The cron jobs are not gracefully stopping cron on an error. Thanks – Shankar Apr 21 at 4:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.