Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle ETCD event cleared exception during blocking lock #250

Closed
wants to merge 3 commits into from

Conversation

ellipses
Copy link

Currently if a lock is held by someone and you try to perform a blocking acquire, its possible for ETCD to return a 401 (etcd.EtcdEventIndexCleared) when more than 1000 events have occurred since the key was modified. This gets caught here https://github.com/jplana/python-etcd/blob/master/src/etcd/lock.py#L130 and another watch call is made with the same arguments which will again fail leaving it in a while True loop of repeated calls that fail.

ETCD docs ( https://coreos.com/etcd/docs/latest/v2/api.html#waiting-for-a-change. ) describe how you recover from this situation by performing a get to obtain the current state and starting a watch from etcd-index + 1 .

@ellipses ellipses changed the title Fix/blocking lock Handle ETCD event cleared exception during blocking lock Aug 13, 2017
@coveralls
Copy link

coveralls commented Aug 13, 2017

Coverage Status

Coverage increased (+0.2%) to 88.302% when pulling be74cd1 on ellipses:fix/blocking-lock into b227f49 on jplana:master.

@ellipses ellipses closed this Aug 14, 2019
@tuxflo
Copy link

tuxflo commented May 25, 2023

Hi!
Sorry for commenting on such an old PR, but may I ask why this was closed without merge?
I'm facing the same problem and it looks like the PR could also solve #254

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants