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

Manual_Synchronization job can end up in infinite loop on pull_inventory step #84

Open
mdbitz opened this issue Mar 20, 2024 · 0 comments
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.

Comments

@mdbitz
Copy link

mdbitz commented Mar 20, 2024

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

  1. Perform a Manual Synchronization

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):

  • WordPress Version : 6.4.3
  • WooCommerce Version : 8.7
  • WooCommerce Square Plugin Version : 4.5.1
  • Browser [e.g. chrome, safari] and Version : N/A
  • Any other plugins installed : N/A

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.

@vikrampm1 vikrampm1 added 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. labels Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants