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

Ensure install procedure only runs once #37480

Draft
wants to merge 7 commits into
base: trunk
Choose a base branch
from

Conversation

peterfabian
Copy link
Contributor

@peterfabian peterfabian commented Mar 28, 2023

All Submissions:

Changes proposed in this Pull Request:

This is an experimental implementation of a proper locking mechanism using INSERT INTO ... ON DUPLICATE KEY UPDATE. There is some discussion to be had about the effects of locking the whole wp_options table in the case of MyISAM engine or how the gap locks would work in the case of InnoDB engine.

The motivation was to avoid race conditions by using non-atomic test and set for wc_installing transient. Plus, a transient can be removed at any point prior its expiry, so there are really no guarantees about the existing locking solution.

How to test the changes in this Pull Request:

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you created a changelog file for each project being changed, ie pnpm --filter=<project> changelog add?
  • Have you included testing instructions?

FOR PR REVIEWER ONLY:

  • I have reviewed that everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities. I made sure Linting is not ignored or disabled.

@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Mar 28, 2023

Test Results Summary

Commit SHA: 15f15a7

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 51s
E2E Tests1870010019712m 22s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@codecov
Copy link

codecov bot commented Mar 28, 2023

Codecov Report

Merging #37480 (15f15a7) into trunk (9c8249f) will increase coverage by 6.0%.
The diff coverage is 90.6%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             trunk   #37480      +/-   ##
===========================================
+ Coverage     45.7%    51.7%    +6.0%     
- Complexity   17197    17257      +60     
===========================================
  Files          429      429              
  Lines        64918    79690   +14772     
===========================================
+ Hits         29696    41199   +11503     
- Misses       35222    38491    +3269     
Impacted Files Coverage Δ
...ocommerce/includes/abstracts/abstract-wc-order.php 76.0% <ø> (+0.2%) ⬆️
...commerce/includes/admin/class-wc-admin-notices.php 16.3% <ø> (-1.5%) ⬇️
...ugins/woocommerce/includes/class-wc-post-types.php 1.4% <0.0%> (-1.2%) ⬇️
...ins/woocommerce/includes/wc-template-functions.php 12.2% <0.0%> (+0.3%) ⬆️
...s/data-stores/abstract-wc-order-data-store-cpt.php 91.6% <87.5%> (-0.7%) ⬇️
plugins/woocommerce/includes/class-wc-install.php 70.4% <100.0%> (+1.4%) ⬆️
...rs/Version1/class-wc-rest-orders-v1-controller.php 67.2% <100.0%> (+21.0%) ⬆️
...rs/Version2/class-wc-rest-orders-v2-controller.php 94.4% <100.0%> (+4.6%) ⬆️
...ion2/class-wc-rest-system-status-v2-controller.php 91.5% <100.0%> (+5.9%) ⬆️
...ugins/woocommerce/includes/wc-update-functions.php 2.4% <100.0%> (+1.0%) ⬆️

... and 335 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: woocommerce Issues related to the WooCommerce Core plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant