-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Prevent status flap when re-registering a check #4904
Prevent status flap when re-registering a check #4904
Conversation
6ea0fe1
to
7908489
Compare
When registering a service each healthcheck status is saved and restored to avoid unnecessary flaps in health state. This change extends this feature to single check registration, so that both `PUT /v1/agent/service/register` and `PUT /v1/agent/check/register` behave in the same indempotent way.
7908489
to
6b7c38e
Compare
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
Thanks @Aestek @pierresouchay, I've added it to the list to consider first glance seems good. To make sure I understand, The code that is removed here already means that |
@banks yes, |
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.
Looks good to me.
@mkeeler thank you |
Fixes point
#2
of: #4903When registering a service each healthcheck status is saved and restored (https://github.com/hashicorp/consul/blob/master/agent/agent.go#L1914) to avoid unnecessary flaps in health state.
This change extends this feature to single check registration by moving this protection in
AddCheck()
so that bothPUT /v1/agent/service/register
andPUT /v1/agent/check/register
behave in the same idempotent way.Steps to reproduce
passing
critical
topassing
(the delay for this transission is determined by https://github.com/hashicorp/consul/blob/master/agent/checks/check.go#L95)