Issue Details (XML | Word | Printable)

Key: ZF-5740
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Satoru Yoshida
Reporter: Teemu Louhekari
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Partial cleaning in Zend_Cache_Backend_TwoLevels::clean()

Created: 10/Feb/09 11:09 PM   Updated: 21/Aug/09 07:59 PM   Resolved: 21/Aug/09 07:59 PM
Component/s: Zend_Cache
Affects Version/s: 1.7.4
Fix Version/s: 1.9.2

Time Tracking:
Not Specified

Fix Version Priority: Should Have


 Description  « Hide

The following lines stop the cleaning process as soon as just one remove() call fails:

foreach ($ids as $id) {
  $res = $res && $this->_slowBackend->remove($id) && $this->_fastBackend->remove($id);
}

Personally I've experienced this as Zend_Cache_Backend_Apc::remove() has failed for some reason.

The problem concerns modes CLEANING_MODE_MATCHING_TAG, CLEANING_MODE_NOT_MATCHING_TAG, and CLEANING_MODE_MATCHING_ANY_TAG.

A possible fix:

foreach ($ids as $id) {
  $res = $this->remove($id) && $res;
}

By the way, currently the return value isn't consistent with Zend_Cache_Backend_TwoLevels::remove(), where only the slow backend return value is used.



Fabien MARTY added a comment - 11/Feb/09 09:33 AM

it seems to be a good idea

I will implement it in the next week

thanks


Fabien MARTY added a comment - 17/Jul/09 11:03 AM

change Assignee because I'm inactive now


Satoru Yoshida added a comment - 19/Aug/09 07:24 AM

In $this->remove($id) method, we can not retrieve return value of $this->_fastBackend->remove($id) now .(trunk r16971)

the $this->remove($id) is :

public function remove($id)
    {
        $this->_fastBackend->remove($id);
        return $this->_slowBackend->remove($id);
    }

I think the method may be better as following:

public function remove($id)
    {
        $canRemoveFast = $this->_fastBackend->remove($id);
        $canRemoveSlow = $this->_slowBackend->remove($id);
        return $canRemoveFast  && $canRemoveSlow ;
    }

Satoru Yoshida added a comment - 21/Aug/09 07:59 PM

Solved in SVN r17740