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
Conversation
- 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)} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this 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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
less than alloted time
closed)
Signed-off-by: Ivan Kozlovic ivan@synadia.com
/cc @nats-io/core