You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TL;DR: The ephemeral lock is timing out 2x the value (in seconds) of lock_timeout_seconds
I'm running into this issue as the experimental result of the lock timeout is actually 2 times longer than the timeout that set when initializing the lock.
My experiment has a basic idea as following:
Each host has consul agent running and all connect to the same consul server. Each host has test.py that will be controlled to run from another host.
The full log is too long to show, but the basic idea is that this happen all through the 2000 times that we trying to acquire the lock and let the lock expire after 10 sec - instead of 10 sec, lock expired after 20 sec.
I tried some other time out like 15 and 60 seconds, the following output is produced through the consul key value storage :
I wonder if this is some errors or some conflicts between the lock and consul ttl? As the expected timeout should be around the lock_timeout_seconds we set.
The text was updated successfully, but these errors were encountered:
I believe that is more or less expected based on the docs and how Consul treats session and lock ttl. But I'd like to elaborate more when I have a chance to give a fuller explanation of how this library could be used. Long story short, I think using the sessions this way may be abusing the Consul API a bit and I'm not confident this approach will perform well under a high volume of traffic.
I'll open another issue to discuss possible performance implications due the current implementation of this library and Consul.
Greetings.
In my experience, the sessions indeed live almost 2* the provided TTL.
But your code should normally release the locks, and you rely on the sessions only to delete locks if the process died, isn't so?
TL;DR: The ephemeral lock is timing out 2x the value (in seconds) of lock_timeout_seconds
I'm running into this issue as the experimental result of the lock timeout is actually 2 times longer than the timeout that set when initializing the lock.
My experiment has a basic idea as following:
Each host has consul agent running and all connect to the same consul server. Each host has test.py that will be controlled to run from another host.
On the another host, I run like:
The test.py is:
The result from the above experiment is something like below:
The full log is too long to show, but the basic idea is that this happen all through the 2000 times that we trying to acquire the lock and let the lock expire after 10 sec - instead of 10 sec, lock expired after 20 sec.
I tried some other time out like 15 and 60 seconds, the following output is produced through the consul key value storage :
I wonder if this is some errors or some conflicts between the lock and consul ttl? As the expected timeout should be around the lock_timeout_seconds we set.
The text was updated successfully, but these errors were encountered: