[wp-trac] [WordPress Trac] #37696: WP_Comment_Query looses sql_clauses with Object Cache

WordPress Trac noreply at wordpress.org
Wed Aug 17 18:16:42 UTC 2016


#37696: WP_Comment_Query looses sql_clauses with Object Cache
-------------------------------------+---------------------------
 Reporter:  Rarst                    |       Owner:  boonebgorges
     Type:  defect (bug)             |      Status:  reviewing
 Priority:  normal                   |   Milestone:  4.6.1
Component:  Comments                 |     Version:  4.6
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------------
Changes (by boonebgorges):

 * keywords:   => has-patch needs-testing


Comment:

 Thanks, @Rarst.

 I looked into this a bit more, and it does seem to be related to a
 partially primed cache. I'm uncertain how this happens in the wild, since
 all caches are linked to the same 'last_changed' incrementor - meaning
 that they should all stand or fall together. Clearly, though, there are
 cases where they can be out of sync, so the query in question should be
 more resilient.

 In [attachment:37696.diff], I discarded the technique that relied on the
 existing SQL clauses, in favor of a fresh call to `get_comments()`.
 There's also a test there that contrives a situation that demonstrates the
 failure.

 @Rarst Are you able to test this patch in an environment where you're
 experiencing the bug?

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


More information about the wp-trac mailing list