|
|
|
|
|
by deathanatos
458 days ago
|
|
It shouldn't. I've not had the braincells yet to fully internalize the entire article, but it seems like we go wrong about here: > The AWS Load Balancer keeps sending new requests to the target for several seconds after the application is sent the termination signal! And then concluded a wait is required…? Yes, traffic might not cease immediately, but you drain the connections to the load balancer, and then exit. A decent HTTP framework should be doing this by default on SIGTERM. > I yelled into the void about this once and I was told that this was inevitable because it's an eventually consistent distributed system. Yeah, I wouldn't agree with that either. A terminating pod is inherently "not ready", that not-ready state should cause the load balancer to remove it from rotation. Similarly, the pod itself can drain its connections to the load balancer. That could take time; there's always going to be some point at which you'd have to give up on a slowloris request. |
|
This is how all pre-k8s rolling deployment systems I've used have worked.
So instead we move the logic to the application, and put a sleep in the shutdown phase to account for the time it takes for the load balancer to process/acknowledge the shutdown and stop routing new traffic to that node.