aws / aws/containers-roadmap

[ECS] [request]: Add startInterval to Container Health Check

Open
#2,473 0 comments 10 reactions 1 assignee Claimed by @staceywhou View on GitHub
ECS Proposed
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**
Add a `startInterval` parameter to the container health check. This was added to the Docker Engine in v25 (https://github.com/moby/moby/pull/40894) so it now needs to be exposed by ECS.

**Which service(s) is this request for?**
ECS

**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
In my scenario I have a slow starting application. We don't want it's health to be evaluated for the first 120 seconds (to give it time to start and settle), but after that we want it's health to be evaluated every 30 seconds. Today if you set the `startPeriod` to 120 seconds and the `interval` to 30 seconds, three health checks run before the start period has finished. If all those health checks fail, then it is not a problem, the container will stay in an `UNKNOWN` state. However if one of those health checks passes, the container will get marked as `HEALTHY` due to:

> If a health check succeeds within the startPeriod, then the container is considered healthy and any subsequent failures count toward the maximum number of retries.

https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_HealthCheck.html

Once a container gets marked as `HEALTHY` things happen in ECS (such as old tasks are stopped), therefore we have to write logic so that a health check must fail within the first 120 seconds of the container starting. The `startInterval` will allow us to remove this custom logic, have no health checks run during the `startPeriod`, and then after that `startPeriod` our frequent health checks.

**Are you currently working around this issue?**
We have to write logic so that a health check has to fail within the first 120 seconds of the application starting.

**Additional context**
Anything else we should know?

**Attachments**
If you think you might have additional information that you'd like to include via an attachment, please do - we'll take a look. (Remember to remove any personally-identifiable information.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.