WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #31245, comment 50


Ignore:
Timestamp:
05/06/2017 02:24:03 PM (3 years ago)
Author:
spacedmonkey
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31245, comment 50

    initial v1  
    11In 31245.3.diff I try something a little different. I really like the changed in  31245.2.diff however, I don't think that is fixes the race condition, where autoloaded options revert. In my patch just deleted the alloptions cache value after add/update/delete options. It treats alloptions cache as poisoned on update and deletes it. I believe this is the best and most simple solution to this error. It is also how the meta api works. https://github.com/WordPress/WordPress/blob/master/wp-includes/meta.php#L107
    22
     3Delete the alloption cache brings some problems. It does mean that next time you interact with options, it will call load_all_options again, resulting in another query. This added query broke a lot of the tests, so I had to remove tests that do query counting. Query counting as a test feel like a bad way to test.
     4
    35As for WP_Option and WP_Option_Query, this is great work and should be broken into another ticket.