Issues

ZF-5740: Partial cleaning in Zend_Cache_Backend_TwoLevels::clean()

Issue Type: Bug Created: 2009-02-10T23:09:23.000+0000 Last Updated: 2009-08-21T19:59:15.000+0000 Status: Resolved Fix version(s): - 1.9.2 (25/Aug/09)

Reporter: Teemu Louhekari (ttl) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Cache

Related issues: Attachments:

Description

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

<pre class="highlight">
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:

<pre class="highlight">
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.

Comments

Posted by Fabien MARTY (fab) on 2009-02-11T09:33:09.000+0000

it seems to be a good idea

I will implement it in the next week

thanks

Posted by Fabien MARTY (fab) on 2009-07-17T11:03:31.000+0000

change Assignee because I'm inactive now

Posted by Satoru Yoshida (satoruyoshida) on 2009-08-19T07:24:09.000+0000

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

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

<pre class="highlight">
    public function remove($id)
    {
        $this->_fastBackend->remove($id);
        return $this->_slowBackend->remove($id);
    }

I think the method may be better as following:

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

Posted by Satoru Yoshida (satoruyoshida) on 2009-08-21T19:59:14.000+0000

Solved in SVN r17740

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts