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

Update to LameDuck mode #817

Merged
merged 2 commits into from Nov 29, 2018
Merged

Update to LameDuck mode #817

merged 2 commits into from Nov 29, 2018

Conversation

kozlovic
Copy link
Member

  • Increase grace period to 10sec
  • Make default 2min
  • Reject config with value less than 30sec
  • Don't wait more than 1sec between clients if there are much
    less than alloted time
  • Stop after last one (was still sleeping after last client was
    closed)

Signed-off-by: Ivan Kozlovic ivan@synadia.com

/cc @nats-io/core

- Increase grace period to 10sec
- Make default 2min
- Reject config with value less than 30sec
- Don't wait more than 1sec between clients if there are much
  less than alloted time
- Stop after last one (was still sleeping after last client was
  closed)

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@@ -479,6 +479,11 @@ func (o *Options) ProcessConfigFile(configFile string) error {
errors = append(errors, err)
continue
}
if dur < 30*time.Second {
err := &configErr{tk, fmt.Sprintf("invalid lame_duck_duration of %v, minimum is 30 seconds", dur)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably do 1 sec if we have time, and hence exit early if we have small number of clients.

So LB = 60 sec. Grace = 10secs. So 50Sec window, if NumClients < 50, Close 1 every second. Then exit when NumClients == 0.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do max the sleep to ~1sec in this PR per client, so will exit early. What I don't do, is reduce the total time by the grace period. Should I?

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.08%) to 92.183% when pulling cfc5ec4 on fix_ld_mode into 7ef7fdf on master.

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

Successfully merging this pull request may close these issues.

None yet

3 participants