Server pods keep serving while they leave the Services #44

Merged
jcoffey-dev merged 1 commits from fix/server-shutdown-delay into main 2026-11-20 22:58:45 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev af7bca629d Server pods keep serving while they leave the Services
ci / chart (pull_request) Successful in 1m8s
lab / e2e the lab on GitHub passed
The server closes its listeners as soon as it gets SIGTERM, and Kubernetes
takes a stopping pod out of the Services' endpoints at the same time, not
before. A request routed to the pod in between finds the port closed: the
lab's GitOps upgrade saw a webmail request fail with "could not reach the
mail server" that way, once in four runs.

server.shutdownDelaySeconds (5 by default) is a preStop sleep, the kubelet's
own (stable since Kubernetes 1.34; the chart needs 1.35), so the image
needs no sleep binary. 0 turns it off; it has to be less than
terminationGracePeriodSeconds, which it counts toward.
2026-11-20 15:53:29 -07:00