[wp-trac] [WordPress Trac] #63450: Race condition for transient with no expiration and object cache active
WordPress Trac
noreply at wordpress.org
Fri Aug 22 04:12:34 UTC 2025
#63450: Race condition for transient with no expiration and object cache active
-----------------------------+---------------------
Reporter: hugod | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.9
Component: Cache API | Version:
Severity: normal | Resolution:
Keywords: has-patch close | Focuses:
-----------------------------+---------------------
Changes (by peterwilsoncc):
* keywords: has-patch => has-patch close
Comment:
I'm strongly inclined to close this as wontfix. There's a few reasons so I
apologise if this becomes long winded.
The [https://github.com/WordPress/wordpress-develop/pull/8826 linked pull
request] modifies the transients to store them in both the options table
and the object cache.
For sites with a persistent object cache, this will result in the
transients being cached twice: once in the transient and once in the
`options` group. For non-expiring transients the option will be stored in
the `alloptions` cache. This will have an adverse affect on the
performance on these sites as the double storage will lead to increased
evictions and potential issues caused by the size of the `alloptions` key.
Toggling the object cache on and off in the manner described isn't a good
idea and will lead to problems. If the caching server is flaky, I consider
that a hosting error that needs to be resolved, no different to a database
server being flaky.
> If some major feature depends on this transient (e.g. rewrite rules), it
can lead to weird behaviors that are hard to debug.
I'm not too concerned about this because transients are designed to be
highly disposable, their existence from one second to another isn't
guaranteed; this is the case even for non-expiring transients.
If a feature requires data be persistent in some fashion, then transients
aren't the solution.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63450#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list