Skip to content

redis has changed their lock API in a backwards incompatible fashion #220

@rsgmon

Description

@rsgmon

I'm using the Redis backend and basically copied the code from the module in sqlalchemy that contains the CachingQuery class. However I am using manual keys.

With the following configuration I get the intermittent error in subject line.

regions["default"] = make_region(key_mangler=md5_key_mangler).configure( "dogpile.cache.redis", expiration_time=3600, arguments={ "host": config["redis"].get("host"), "redis_expiration_time": 60 * 60 * 2, "distributed_lock": True, "thread_local_lock": False, }, )

Here's the code where it occurs:

`

    _async = False
    if self._has_value(createdtime):

        has_value = True

    -->   if not self.mutex.acquire(False):

            log.debug("creation function in progress elsewhere, returning")

            return NOT_REGENERATED

    else:

        has_value = False

        log.debug("no value, waiting for create lock")`

Any suggestions would be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingredis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions