jplana / python-etcd

A python client for etcd
Other
520 stars 210 forks source link

lock.aquire fall into infinite loop #254

Open triStone opened 6 years ago

triStone commented 6 years ago

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?

triStone commented 6 years ago

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

aawilson commented 5 years ago

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.