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

Waiting two ttl-periods before declaring a lease lost seems wrong #155

Open
mrosenc opened this issue Sep 8, 2021 · 0 comments
Open

Waiting two ttl-periods before declaring a lease lost seems wrong #155

mrosenc opened this issue Sep 8, 2021 · 0 comments

Comments

@mrosenc
Copy link

mrosenc commented Sep 8, 2021

I was reading the code to understand the lease refresh algorithm and notice this:

    // When the cluster goes down, we keep trying to reconnect. But if we're
    // far past the end of our key's TTL, there's no way we're going to be
    // able to renew it. Fire a "lost".
    if (Date.now() - this.lastKeepAlive > 2 * 1000 * this.ttl) {
      ...
    }

Waiting 2 *ttl seem problematic, the process will believe it has the lease a full ttl period after it has certainly lost it. Can this be configurable somehow? Why isn't it just 1 period?

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

No branches or pull requests

1 participant