[ECS] Task Replacements
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
Hi
This isn’t really a feature request but a question or requiring some assistance, though it might turn into a feature request depending on the outcome.
First let me layout my scenario or setup. Basically I have an ECS service which has the following configuration:
- desired count: 1
- health check grace period: 600 seconds
- min/max task percentage: 100/200
- launch type: Fargate
- health check configured within the container
### Scenario
After a successful deployment I would have 1 running healthy task. However after some time the one container started reporting unhealthy on its checks with ECS task replacement mechanism and since the max number of tasks that can run is configured to 200% which means 2 task, ECS will spin up 1 more task now a total of 2 task running. And within the health check grace period the new replacement task may report unhealthy therefore at some point you would get 2 running tasks (the old and new one) that are unhealthy. In this scenario I would expect ECS to wait either until the health check grace period has expired or the new container becomes healthy (whichever comes first) before terminating the old running unhealthy container, however the actual behaviour is that ECS terminates the old unhealthy running container when both the old and new replacement containers becomes unhealthy even if it’s still within the health check grace period. My question is: Is this the correct behaviour or is there something I can configure to tell ECS to not terminate the old running unhealthy container and either wait for the replacement container to become healthy (as long as it is within the health check grace period) or the health check grave period has expired and the replacement container is still unhealthy?
Sorry for the long post but just wanted to be clear and provide as much context as possible.
Thanks
Contributor guide
Research direction
Start with the ECS service configuration and scenario in the issue, especially desired count, health-check grace period, deployment percentages, and Fargate launch type. Compare the observed replacement behavior with documented ECS semantics; done means confirming whether it is expected or identifying a supported configuration that prevents early termination.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100