Problem/Motivation

It's not very clearly documented but DrupalCacheInterface ::clear() accepts an array as $cid.
Checkout the handling in DrupalDatabaseCache::clear()
As far as I can tell currently the redis cache backend doesn't take that into account. What leads to strange behaviour e.g. with entitycache enabled, which uses arrays as cid.

Proposed resolution

Add a loop in Redis_Cache::clear() to handle array cid.

Remaining tasks

Reviews needed.

User interface changes

none

API changes

none

CommentFileSizeAuthor
redis-fix-cache-clear.patch559 bytesdas-peter

Comments

pounard’s picture

Thank you very much, will do a review and push after some tests as soon as I can, can you provide a procedure to reproduce the bug?

das-peter’s picture

Unfortunately I stumbled over this issue while executing one of our migration jobs. And as it was reproducible I used this job for further debugging. Thus I don't have an isolated procedure how to reproduce this.

das-peter’s picture

Please consider to review following issue too as it will help to avoid such issues in the future: #1871028: Enhance documentation of DrupalCacheInterface::clear()

pounard’s picture

Will do, thanks.

pounard’s picture

Status: Needs review » Fixed

Pushed at http://drupalcode.org/project/redis.git/commit/f0cf25
A new release including this patch and a few others fixing mostly the Predis backend will happen in a few minutes.

Thank you very much.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit f0cf25b on 7.x-2.x, 7.x-2.x-sharding, 7.x-2.x-path by Pierre.R:
    #1871006 - authored by das-peter - Flaw in the implementation of...