-
Notifications
You must be signed in to change notification settings - Fork 18
updated liveness and readiness probe descriptions #106
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
Conversation
51d1c97 to
030a667
Compare
b27d823 to
5794f72
Compare
|
I'll also add a paragraph at the end about the values used for readiness. Main thing with startup probe will be why we don't use it. |
5794f72 to
b7cc6da
Compare
b7cc6da to
f992617
Compare
adoptingerlang.org
Outdated
| maintenance, it can return a =503= status response for readiness causing it to be | ||
| removed from the =Service= backends. | ||
|
|
||
| Nothing special is needed to have a graceful shutdown, for any reason, whether |
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.
Eeeeh, if you don't remove yourself from the load balancer pool, some gateways (like ALBs or ELBs) may still try to send traffic to a process that's halfway through shutting down, and that will cause interrupted connections that are forwarded to the client. This may however be stack dependent because not all stacks clean up as nicely and orderly as an OTP tree.
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.
Removal should already be handled by k8s. There is always delay, even in the case of the readinessProbe being setup to return 503 on shutdown since the check is only done every period seconds, but its handled by k8s and not the application itself is my point. Maybe it needs rewording?
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.
Yeah that could make it clearer. It's possible this was just my misunderstanding and I didn't realize that being in a shutting down state also automatically took you out.
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.
Actually, I should probably mention the use of prep_stop. I haven't implemented this in service_discovery because it is a little tricky in its case since it has 2 applications, one for http and one for grpc, that both have to wait until active requests are handled before shutting down.
I suppose I should also mention the need to have a proper boot order and supervision tree so that stuff like the database pool aren't shutdown before the http app can pause to complete open requests.
I could just add a "see Graceful Shutdown section (to come)" for more...
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.
Eh, maybe it isn't tricky, was overthinking it. It is the same whether they are both in the release or not. Each can wait for their active connections one after the other and the SIGKIll takes care of it if they take too long.
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.
Wait, yea, this is just k8s specific. I will just add a callout to another section and with saying in k8s you don't need to do anything special, but see this section for how to handle the shutdown in your Erlang application.
Co-authored-by: Fred Hebert <mononcqc@ferd.ca>
Co-authored-by: Fred Hebert <mononcqc@ferd.ca>
Co-authored-by: Fred Hebert <mononcqc@ferd.ca>
Co-authored-by: Fred Hebert <mononcqc@ferd.ca>
22ec8ec to
5144f31
Compare
| readinessProbe: | ||
| httpGet: | ||
| path: /healthz | ||
| path: /ready |
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.
might be interesting to eventually aim for /health/<type> but we're good to go here.
I still need to add a paragraph about the startup probe. I'm not planning on using it in service_discovery.