By using AWS re:Post, you agree to the Terms of Use

Delayed shutdown of ECS Fargate tasks?



I have a problem with delayed shutdown of ECS Fargate tasks, let me explain by example:

  • in a Docker image at the very last line of the entrypoint script I have simple echo statement. It's being logged at 11:18:22.004
  • I have another process, which is checking ECS tasks statuses on some events, an it's logged that at 11:18:30.023 (8 s later execution of last line of entrypoint) both last and desired statuses of the task are RUNNING

So my question is it expected that ECS Fargate takes more than 8 secs to shutdown task, specially considering that desired status also remains RUNNING after that time.

1 Answer

An ECS/Fargate tasks stops when the application in your container stops (or for that matter if a critical container exits for any reason). If your container doesn't shut down, the task will keep on running. It would be good to take a closer look and see if there are any additional processes that continue to run in this case.

profile picture
answered 8 months ago
  • Thanks for this guess. Indeed in the middle of the entrypoint I launch some 3rd party software, which might be spawning process(es). I'll try to verify that and decrease stopTimeout of container to see if it helps.

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