Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.10.0
-
Fix Version/s: Next Major Release
-
Component/s: Zend_Cache
-
Labels:None
Description
While using the memcached backend there's no way to specify that a save should not occur if there is already a value in the cache thereby indirectly causing race conditions when adding a semaphore. By implementing an option to specify semaphoreIds this can be avoided.
if (!(array_key_exists($id, $this->_options['semaphoreIds']))) {
// ZF-8856: using set because add needs a second request if item already exists
$result = @$this->_memcache->set($id, array($data, time(), $lifetime), $flag, $lifetime);
} else {
$result = $this->_memcache->add($id, array($data, time(), $lifetime), $flag, $lifetime);
}
Diff file for proposed improvement.