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
drain container instance on termination #1692
Conversation
MiguelMoll
commented
Feb 7, 2017
•
edited
edited
- Test cron/one-off jobs
- Needs time out? Lambda has a 5 minute max
Codecov Report
@@ Coverage Diff @@
## aws-update #1692 +/- ##
=============================================
+ Coverage 30.9% 30.9% +<.01%
=============================================
Files 140 140
Lines 13608 13608
=============================================
+ Hits 4205 4206 +1
+ Misses 8961 8960 -1
Partials 442 442
Continue to review full report at Codecov.
|
@@ -114,6 +129,32 @@ func handle(r Record) error { | |||
return nil | |||
} | |||
|
|||
func waitForInstanceDrain(cluster, ci string) error { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to use one of the Waiters in the SDK for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we can and worth a shot. I went this route first to avoid any state changes that happen when calling the Waiter with tasks grabbed before or after instance change to DRAINING
.
Either way, a call to ListTasks()
(w/ next pages in mind for a waiter) is done. Then pass those task into the waiter. Figured we have the data already we could check it directly.
SDK states: Have to handle this case for any scheduled jobs or one off processes that happen to be running. We might have to stop them, as unfortunate as that is. Maybe wait for the lifecycle/lambda (10mins/5mins) timeout? |