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

Update task cleanup wait logic to clean task resources immediately in… #2084

Merged
merged 1 commit into from
Jun 25, 2019

Conversation

mssrivas
Copy link
Contributor

@mssrivas mssrivas commented Jun 13, 2019

Update task cleanup wait logic to clean task resources immediately instead of waiting 3 hours

Summary

Currently if the clean up duration for tasks are not defined, It defaults to 3hr. The current logic in cleanupTask is once it passed the cleanup time, agent will wait for 3 more hours (DefaultTaskCleanupWaitDuration) instead of cleaning up the task immediately. Instead with below changes, it will begin cleanup immediately .

Implementation details

Once it passed the cleanup time, it waits a nanosecond and begins the cleanup task.

Testing

Created a task definition that uses a volume called test_vol. The check for successful clean being that docker volume ls does not return test_vol in the list.
Five cases tested.

  1. No cleanup is specified - The cleanup duration is set to 3hrs
  2. Cleanup specified is negative - The cleanup is set to 3hrs
  3. Cleanup specified is less than minimum value - The cleanup is set to 3hrs
  4. Cleanup specified is 10 mins - Clean up begins after 5min after container goes to stop state
  5. Cleanup specified is 5mins - Clean up begins after 5min after container goes to stop state

Description for the changelog

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mssrivas mssrivas changed the title Update task cleanup wait logic to clean task resources immediately in… [WIP]Update task cleanup wait logic to clean task resources immediately in… Jun 13, 2019
@mssrivas mssrivas marked this pull request as ready for review June 13, 2019 19:00
@ubhattacharjya
Copy link
Contributor

Can you describe how did you verify that the task resources got cleaned up in the testing done section?

@mssrivas mssrivas force-pushed the Issues branch 3 times, most recently from d392a81 to 01b5466 Compare June 17, 2019 21:26
@mssrivas mssrivas changed the title [WIP]Update task cleanup wait logic to clean task resources immediately in… Update task cleanup wait logic to clean task resources immediately in… Jun 25, 2019
@mssrivas mssrivas merged commit 61152f4 into aws:dev Jun 25, 2019
@mssrivas mssrivas added this to the 1.29.1 milestone Jul 2, 2019
@mssrivas mssrivas deleted the Issues branch April 23, 2020 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants