8000 PotteryRedLock.locked() does not show real ttl · Issue #701 · brainix/pottery · GitHub
[go: up one dir, main page]

Skip to content

PotteryRedLock.locked() does not show real ttl #701

Open

Description

@matroskin8

Describe the bug
If we define two objects of PotteryRedLock with same key (for example at different app instances), their locked() methods does not show states of other object

To Reproduce
Steps to reproduce the behavior:

PotteryRedLock(key='key', masters=masters, auto_release_time=60).acquire()
PotteryRedLock(key='key', masters=masters).locked()

locked() will return 0, that means lock could be acquired, but second try to acquire will blocks for up to 60 seconds

Expected behavior
locked() returns value close to auto_release_time of first lock

Environment (please complete the following information):

  • OS: [e.g. macOS, Linux]

    uname -a
    Darwin xxx 20.6.0 Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:05 PST 2021; root:xnu-7195.141.14~1/RELEASE_ARM64_T8101 arm64

  • Python version 3.9.15

  • Redis version 6.2.5

Activity

  1. self-assigned this
    on Aug 21, 2023
  2. matroskin8 commented on Aug 21, 2023

    @matroskin8
    Author

    Found that locked() returns wrong value coz self._uuid = None, should it check db if no uuid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    0