cancel
Showing results for 
Search instead for 
Did you mean: 

Deadlock Errors during product save

Deadlock Errors during product save

Magento 1.9 programmatically creating multiple products at a time getting below error.
"Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction"

2 REPLIES 2

Re: Deadlock Errors during product save

Same error for me trying to create several products in parallel through API REST.

Any idea?

Re: Deadlock Errors during product save

Preconditions Magento 2.0.2 PHP 5.6, MySQL 5.6 My Scene To Save/Update large amount(45K) products in Magento from amazon on daily basis. I have developed a custom script to save products in Magento Product is saving properly if i save them one by one. Steps to reproduce saved 10 products at a time by using pcntl_fork(php function). another scenario is NodeJS async call to Magento API's {each api call will save one product} and i limit the calls to 5 at a time. but still same error. i also change indexing on "Update by Schedule". and done indexing manually by command at last. Expected result product should be save Actual result Some of the products are saved successfully but some failed in ratio of 70%-30% respectively. Log Errors- Asymmetric Transaction rollback. Deadlock Errors. Serialization failure. These are the general message of errors. one of my friend also suggest me to change innoDB lock or some serialization properties of MySQL, but as i thought these changes will make some other effect on magento application. Description i am saving custom product in magento 2.0.x. it is working fine when i am saving them one by one. but as i have to save 45k products and to make my process fast, i saved multiple product at same time. at this time magento is throwing exception of deadlock. Exception line :- /vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php235 Exception :- SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction, query was: INSERT INTO catalog_product_entity (attribute_set_id, type_id, sku, created_at, updated_at) VALUES (?, ?, ?, '2016-06-29 12:29:57', '2016-06-29 12:29:57')

 

Source link: 

https://github.com/magento/magento2/issues/5351

https://www.5staressays.com/blog/persuasive-essay-topics

https://magento.stackexchange.com/questions/259911/magento-1-9-1-0-deadlock-error-when-saving-a-prod...