[ECS] [request]: Match the status retrieved from the task metadata endpoint with the actual task status
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
Plese match the value of KnownStatus retrieved from the task metadata endpoint with the value of lastStatus from the response of DescribeTasks API.
**Which service(s) is this request for?**
ECS Agent
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Currently, there is the below difference between the KnownStatus retrieved from the task metadata endpoint and the lastStatus from the DescribeTasks API response.
- lastStatus: RUNNING -> DEACTIVATING-> STOPPED
- KnownStatus: RUNNING -> STOPPED
Therefore, it is currently not possible to perform a graceful shutdown after detecting the DEACTIVATING status within the task.
**Are you currently working around this issue?**
Handling [Task state change events](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_cwe_events.html#ecs_task_events) is a workaround.
**Additional context**
ECS Agent 1.70.2
Contributor guide
Assessment
This issue has not been assessed yet.