Is it possible to send a SIGTERM signal before connection draining when deploying a new task definition in ECS?

0

We have an application that requires clients to have long lasting socket connections, and have code in place application side to gracefully handle a SIGTERM event. It does depend on connections remaining established but my observation is that the SIGTERM happens after the de-registration delay has elapsed and thus all active connections are killed.

Is there a mechanism by which the SIGTERM can be sent before connection draining starts, or perhaps some other signal that would otherwise tell us that the application instance will soon be terminated?

alibc
asked a year ago1109 views
1 Answer
0

The ALB connection draining will always happen before a SIGTERM signal is sent to the container. After the deregistration delay any remaining connections will get 5xx errors and SIGTERM is sent to the container. The 'Reacting to SIGTERM' section of the Graceful shutdowns in ECS blog has a diagram describing the sequence of events when a service is scaled down.

AWS
Noah_L
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions