logoalt Hacker News

deathanatos • yesterday at 7:30 PM • 2 replies • view on HN

I agree wholeheartedly with you that handling abnormal termination is probably the first thing you should do.

But I disagree with you on "the culture around k8s in practice ignores this to a dangerous degree" — yes, k8s clusters have built-in methods of handling normal termination¹. But that because abnormal termination — while an expected and "normal" consequence of production in the sense that it will, invariably, happen — still has knock-on effects, like 500s. If I SIGKILL your serving process, those requests are dead². The graceful stuff is there to avoid inadvertently nuking requests like that during normal deployments.

Again, I absolutely agree: your desired workload should survive everything from SIGKILL to the machine just up and vanishing into thin air, and the subsequent delay that it will take health checks to realize "huh, weird, that VM just poofed out of existence". (And you should probably deal with that first, as systemic failures like what MS hit are less preferable than a few 5xxs here and there.)

¹which for a workload, amounts to, pretty much "handle SIGTERM", or more practically, "your web framework, if it is worth its salt, should already be doing this for you"

²while sometimes an upstream LB can smartly retry idempotent requests, if the requests aren't idempotent, there is no choice but 5xx


Replies

skylurk • yesterday at 7:35 PM

Still I don't think I figured out graceful shutdowns in k8s (but that is kinda the point, processes are not pets)

mosura • yesterday at 7:42 PM

You are arguing from idealism, while I am from what people actually do when presented with those mechanisms.

I know infinitely more SV cos with zero abnormal termination recovery than those with graceful shutdowns for the simple reason one is tested all the time and the other is too hard to deal with so everyone hopes they have moved to the next company before dealing with it.

➕ show 1 reply