[wp-trac] [WordPress Trac] #25623: The design of update_option etc makes race conditions likely to happen

WordPress Trac noreply at wordpress.org
Sun Feb 16 22:37:09 UTC 2014


#25623: The design of update_option etc makes race conditions likely to happen
-------------------------------------------+-----------------------------
 Reporter:  joehoyle                       |       Owner:
     Type:  defect (bug)                   |      Status:  new
 Priority:  normal                         |   Milestone:  Future Release
Component:  Cache API                      |     Version:
 Severity:  normal                         |  Resolution:
 Keywords:  reporter-feedback needs-patch  |     Focuses:
-------------------------------------------+-----------------------------

Comment (by joehoyle):

 Replying to [comment:2 wonderboymusic]:
 > Would it be possible for you to create a unit test demonstrating this
 issue, potentially with a fix?

 IMO this is too early to start writing any code - it was more about the
 discussion to see if this is something that _should_ be tackled. The
 problem is not necessarily a "bug" in the usual sense that there is
 something that can be fixed. Running code in parallel is always going to
 be a problem with WordPress, however it's more that `all_options` makes
 overwrites a lot more likely. I was hoping to get some dev feedback as to
 whether this issue is "serious" enough to warrant at upheaval of how the
 `options` object caching is handled.

 Unit tests would at least be good to demonstrate the issue to side-effects
 when calling `update_option` with a race condition. However, I am not sure
 exactly how we do that from PHPUnit with the current setup. One idea: use
 a remote request back to the install to update an option, then call
 `update_option` after the script has returning, and observe that the
 remote request's `update_option` is lost form the object cache. This
 requires a web server in the unit test (which I don't *think* we currently
 have) and also running the tests with Persistent Object Caching (which I
 am not sure we currently have).

--
Ticket URL: <https://core.trac.wordpress.org/ticket/25623#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list