Skip to content

locks with ttls are broken #267

@Roguelazer

Description

@Roguelazer

In the _acquired function of lock.py, the code first sets a key, then calls watch with no timeout. If the lock is held by a peer who ever calls renew(), this causes an uncaught exception.

Specifically, if you're using TTLs, the key might expire before the watch returns, which causes the later call to _acquired to fail.

The whole idea of having a recursive function which contains an infinite loop is kind of hinky.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions