Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Termination order of linked containers #474

Closed
seiffert opened this issue Aug 9, 2016 · 9 comments
Closed

Termination order of linked containers #474

seiffert opened this issue Aug 9, 2016 · 9 comments

Comments

@seiffert
Copy link

seiffert commented Aug 9, 2016

We're experiencing an issue where linked containers in a task aren't terminated in the "correct" order. We would have expected that containers are terminated in a way that consumer containers are terminated before their linked containers.

In our case, a local redis cache is terminated before the consuming web application is. This in turn leads to exceptions in the web application.

Can you tell me whether this is expected behaviour or whether we can request the termination order to be changed? I've tried to dig into the agent's code a bit and think that I've found out that a task's containers aren't terminated in any particular order right now.

@kiranmeduri
Copy link
Contributor

@seiffert thanks for pointing this out. You are right that termination order of containers within a task is non-deterministic. Note that it is deterministic when starting containers based on links and volumes (https://github.com/aws/amazon-ecs-agent/blob/master/agent/engine/dependencygraph/graph.go).

We will look into this and update the issue.

-kiran

@danvaida
Copy link

Any updates on this?

@blablacio
Copy link

@kiranmeduri Also interested in updates on the topic as some of our containers fail because their linked containers are stopped first.

@epiehl
Copy link

epiehl commented Nov 2, 2018

Still no updates? Our workflows are crashing as well due to caching containers being stopped before the applications gracefully exits.

@coultn
Copy link

coultn commented Nov 2, 2018

Thanks for checking in on this. I wanted to let you know that we on the ECS team are aware of this issue, and that it is under active consideration. +1's and additional details on use cases are always appreciated and will help inform our work moving forward.

@petderek
Copy link
Contributor

We are looking at addressing this along with startup order in aws/containers-roadmap#123

@snowhork
Copy link

I opened PR #1809.

If this PR is acceptable, I will complete all testing and request review as soon as possible.

@abicky
Copy link

abicky commented Jan 31, 2019

We link our application container with a fluentd container. However the fluentd container always stops before the application container stops, so some data posted to fluentd lose.

I believe #1809 resolves the issue, so I appreciate if you take a look the pull request and post a comment, for example "This change looks good, so please complete all tests." or "We won't merge this pull request because it will conflicts with aws/containers-roadmap#123".

@coultn
Copy link

coultn commented Jun 10, 2019

Closing this issue because you can now control startup and termination order of containers in the task definition: https://aws.amazon.com/about-aws/whats-new/2019/03/amazon-ecs-introduces-enhanced-container-dependency-management/

@coultn coultn closed this as completed Jun 10, 2019
fierlion pushed a commit to fierlion/amazon-ecs-agent that referenced this issue Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests