-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Add health check timeout parameter #3813
Conversation
0c7a49e
to
795c05d
Compare
Thanks @ldez, I've updated the PR to use that version and it's much cleaner. The Arch package sources go-bindata from /~https://github.com/shuLhan/go-bindata. |
795c05d
to
18aed41
Compare
18aed41
to
f99d616
Compare
Hi @jbiel, thank you for your work.
|
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.
Thank you for this PR.
server/server_loadbalancer.go
Outdated
} | ||
|
||
if timeout >= interval { | ||
interval = timeout + time.Duration(1*time.Second) |
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.
WDYT about just having a warn log and not changing the interval value. I think the +1s is a little bit arbitrary.
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 do this but I'm unsure of the consequences of potentially having multiple health checks running at once. For example:
- Interval is set to 5s
- Timeout is set to 20s
- Backend is taking 15s to respond
In the above case we'll have up to 3 health checks running against a backend at the same time. Is this acceptable?
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.
In fact, we can't launch new healthcheck if we are still waiting for the previous healthcheck response because the healthcheck is in the same goroutine as the interval.
/~https://github.com/containous/traefik/blob/fdf14cd101821b5ab0d5fb62b5ffaa489ad5eaab/healthcheck/healthcheck.go#L116-L126
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.
OK - I've removed the code that changes the interval and changed the log to warn level.
2e6722d
to
82e71ab
Compare
@jbdoumenjou, the PR has been updated to include updates to those tests. |
Could this also be added to the kubernetes provider as |
82e71ab
to
578c599
Compare
578c599
to
9a41266
Compare
9a41266
to
ecdaa54
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
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
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
What does this PR do?
A health check timeout parameter has been added. This allows health checks to set custom timeout periods for backends. This value is currently non-configurable and set to 5 seconds.
If the health timeout is configured to be greater than the interval, an error message is logged and the interval is set to the timeout + 1 second. I did this because I noticed prior art of using sane defaults in the case of invalid configuration (I like this; I appreciate that the daemon doesn't just die.) If there's a better way to handle this or if this isn't desirable I'm open to any necessary changes.
Motivation
An application that we inherited periodically takes > 5 seconds to respond to health check requests and we don't want to consider backends that take longer than 5 seconds to respond unhealthy.
Fixes #3784
More
Additional Notes
make test-unit
was successfulmake docs-verify
was successful and docs look good visuallyautogen/gentemplates/gen.go
changed so much. I rango generate
with go 1.10.3 and go-bindata 3.4.0.