- Issue created by @catch
🐛 Race conditions/bad lock logic in CacheCollector/State Active fixes a race condition in State + CacheCollector but relies on a custom ::set() implementation in State.
It may be possible to handle that logic in CacheCollector::updateCache() - e.g. enable it to be called mid-request when setting a value, handle the various lock conditions, merge the new data with the old cache item if there is one and it hasn't changed, and then skip the end of request logic (except possibly as a fallback if it wasn't possible to acquire the lock).
However, this could be as hard to get right as that issue was, especially without breaking bc, so opening as a follow-up.
The main advantage here apart from code re-use would be that it would make it easier for other implementations similar to state to do the same thing, and it might allow for less cache writes / invalidations - by changing the existing cache item when updating underlying information instead of invalidating it.
Active
11.0 🔥
cache system