Giter Club home page Giter Club logo

Comments (20)

wjimenez5271 avatar wjimenez5271 commented on August 16, 2024 12

+1 for this feature

from amazon-ecs-agent.

CpuID avatar CpuID commented on August 16, 2024 12

Would it be possible to allow an env variable like this to be set on a per container definition basis? As opposed to a global for the ECS agent itself?

I would suggest the container definition option would take precedent over the global, when set to something.

from amazon-ecs-agent.

gjohnson avatar gjohnson commented on August 16, 2024 1

@samuelkarp any reason this could't be configurable via an env var? It's not as nice as API support but beats nothing right?

from amazon-ecs-agent.

euank avatar euank commented on August 16, 2024

It's actually 30s right now. Would you want to make this tunable on a per stop-task call or as an attribute of the container in the task definition, or both?

In reality, a robust application will have to handle shorter termination sometimes because there's no way you can always guarantee a graceful stop.
As a workaround (and yes, I know it's hacky) you can have a way to signal your application to cleanup and exit outside of the stop-task call.

I'll mark this as an enhancement, but I'd like a bit more discussion around whether this really does make sense to have.

from amazon-ecs-agent.

tj avatar tj commented on August 16, 2024

Yeah I don't disagree with that, but currently we have a number of programs feeding from queues which continue processing in-flight jobs on stop down so nothing gets terminated cutting off responses etc. For our use-cases having it in the task def would be great.

from amazon-ecs-agent.

d5 avatar d5 commented on August 16, 2024

+1 / I have the similar use cases and sometimes (especially on high load) 30s is not long enough and it kills my apps at a random point.

from amazon-ecs-agent.

dblackdblack avatar dblackdblack commented on August 16, 2024

👍
I have long running workers running in docker containers which can take 2+ hours to complete a job. 30 seconds isn't nearly long enough. Even shorter running jobs which normally take 1-2 seconds to complete could be running on a really slow EC2 instance or S3 could be really slow, or really any number of things which could cause them to exceed a 30 second timeout, get killed, and loose data.

from amazon-ecs-agent.

kirviq avatar kirviq commented on August 16, 2024

+1
For my application 10 seconds shutdown will almost never suffice, even the 30 seconds for multicontainer tasks will not be enough. On average I guess I need 2-5 minutes for a clean shutdown. I agree a robust architecture should handle any outage, but is there a reason to not make this configurable?

from amazon-ecs-agent.

dblackdblack avatar dblackdblack commented on August 16, 2024

I forked this repo with a 4 hour timeout: https://github.com/dblackdblack/amazon-ecs-agent
Pretty simple diff: dblackdblack@e01a779 which should be pretty easy to keep up to date with newer agent versions. Works great for me so far. I'm not a Go coder so I can't really do much more than this basic hack job nor write up a PR with my desired feature implemented.

from amazon-ecs-agent.

rafkhan avatar rafkhan commented on August 16, 2024

+1 on this.
like @mereel01 said, is there any reason why this timeout shouldn't be configurable?

from amazon-ecs-agent.

dblackdblack avatar dblackdblack commented on August 16, 2024

Basically there's been zero activity for this agent in the past month: https://github.com/aws/amazon-ecs-agent/graphs/contributors?from=2015-08-14&to=2015-09-28&type=c
The only commit is my 1-line README change.

In evaluating whether to use ECS or Kubernetes, this is pretty damning for such a young (and non-free) product, especially when Docker itself is under such rapid development.

from amazon-ecs-agent.

CpuID avatar CpuID commented on August 16, 2024

@dblackdblack +1, I assume there could be internal development outside of GH going on (internal to AWS), but hard to say with certainty.

from amazon-ecs-agent.

samuelkarp avatar samuelkarp commented on August 16, 2024

@dblackdblack That graph only shows commits to master. If you look at the dev branch, you'll see that we're actively working on the Agent.

from amazon-ecs-agent.

dblackdblack avatar dblackdblack commented on August 16, 2024

Oh cool. sorry about that.

from amazon-ecs-agent.

CpuID avatar CpuID commented on August 16, 2024

@samuelkarp apologies also... :)

from amazon-ecs-agent.

samuelkarp avatar samuelkarp commented on August 16, 2024

@gjohnson That sounds fairly reasonable to configure a default timeout by environment variable. If you want to look at how we read environment variables for configuration, this is the best place to start.

from amazon-ecs-agent.

rafkhan avatar rafkhan commented on August 16, 2024

@samuelkarp is this open to be an external contribution?
I'd like to help, but not sure how to get started with writing tests for this.

from amazon-ecs-agent.

samuelkarp avatar samuelkarp commented on August 16, 2024

@rafkhan Sure! Please see our contributing guidelines. The timeout is currently specified here and tests are here.

from amazon-ecs-agent.

rafkhan avatar rafkhan commented on August 16, 2024

contribution inbound soon :)

from amazon-ecs-agent.

mjaverto avatar mjaverto commented on August 16, 2024

@rafkhan before I look to go down the route of changing this myself, did you ever end up doing this without just forking?

from amazon-ecs-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.