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
gefragt vor einem Jahr1189 Aufrufe
1 Antwort
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
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen