Manual_Synchronization job can end up in infinite loop on pull_inventory step #84
Labels
priority: high
The issue/PR is high priority—if affect lots of customers substantially, but not critically.
type: bug
The issue is a confirmed bug.
Describe the bug
When the Manual Synchronization job executes it is possible for the pull_inventory step to never complete. With each execution being recorded back to the job object the underlying job option will continue to grow in size and lead to decreased performance of the website.
To reproduce
Expected behavior
Manual Synchronization needs to be aware of failures and state changes so that the overall job can fail out when pull_inventory is unable to process all variations.
Environment (please complete the following information):
Additional details
https://github.com/woocommerce/woocommerce-square/blob/trunk/includes/Sync/Manual_Synchronization.php#L1395-L1538
The only way for the pull_inventory step to complete is if all variations have been processed. There needs to be additional handling to ensure that if multiple executions occur without changes to processed variations that the job fails out. I saw 39163 executions of pull_inventory where there were:
43 pull_inventory_variation_ids
42 processed_square_variation_ids
0 in_progress_pull_inventory
To resolve I had to explicitly mark the job as complete.
The text was updated successfully, but these errors were encountered: