oliora / ppconsul

C++ client for Consul (http://consul.io)
Boost Software License 1.0
152 stars 57 forks source link

sessions: allow passing zero lockDelay #36

Closed shdown closed 5 years ago

shdown commented 5 years ago

Consul’s docs are inconsistent about this:

https://www.consul.io/docs/internals/sessions.html

While the default is to use a 15 second delay, clients are able to disable this mechanism by providing a zero delay value.

https://www.consul.io/api/session.html#lockdelay

LockDelay (string: "15s") - Specifies the duration for the lock delay. This must be greater than 0.

And consul has a couple of issues open about this:

But, surprisingly, Consul 1.5.0 understands lockDelay=0 as expected, that is, disables the lock delay mechanism for the session.

oliora commented 5 years ago

Nice catch!