Zend Framework

Memcache Semaphore Keys

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor 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);
        }
  1. zf-10097.diff
    09/Jul/10 2:33 AM
    5 kB
    Petrus Rademeyer
  2. zf-10097.diff
    02/Jul/10 7:34 AM
    2 kB
    Petrus Rademeyer

Activity

Hide
Petrus Rademeyer added a comment -

Diff file for proposed improvement.

Show
Petrus Rademeyer added a comment - Diff file for proposed improvement.
Hide
Marc Bennewitz (private) added a comment -

This will be solved within ZF 2.0.
Please read my proposal: http://framework.zend.com/wiki/display/ZFPROP/Zend+Cache+2.0+-+Marc+Bennewitz

Show
Marc Bennewitz (private) added a comment - This will be solved within ZF 2.0. Please read my proposal: http://framework.zend.com/wiki/display/ZFPROP/Zend+Cache+2.0+-+Marc+Bennewitz
Hide
Marc Bennewitz (private) added a comment -

This won't be fixed in ZF1.
-> fixed in ZF2-135

Show
Marc Bennewitz (private) added a comment - This won't be fixed in ZF1. -> fixed in ZF2-135

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: