jplana/python-etcd

lock.aquire fall into infinite loop

Opened this issue · 2 comments

If an EtcdException occurs in lock.py:122, the while loop will fall into an infinite loop.
In my case, "The event in requested index is outdated and cleared" exception occurs in watch method which called at lock.py:122, that makes the lock._acquire method keep log the exception and try to watch the new event again and again.
Is that a bug or I use the acquire method in a wrong way?

In my opinion, the acquire function should throw an exception after timeout.

Concur with this. We're having an issue where this loop is generating tens of thousands of unactionable events for our exception logger.

Via this comment and its responses, it appears that correct behavior is to restart the client and re-read configuration from scratch.