-
Notifications
You must be signed in to change notification settings - Fork 613
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
Fix a issue that agent does not clean task execution credentials from credential manager when stopping a task #2993
Conversation
d00e36a
to
d4d1ae2
Compare
It's definitely the right thing to do to clean up execution role creds. I'm curious how confident we are that this is the issue contributing to the memory leak? The structure used for storing creds contains string fields only (and short ones too it seems), which usually won't take megabytes of memory I feel like. There could be something else i'm missing. I think it would be great if we could run the experiment a few more times and observe the consistency. |
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.
from the testing, it looks like some amount of memory leak is mitigated with this change, but not fully. is that right?
May be this questions is out of this PR scope but I am wondering if we are currently only cleaning up the latest task and execution credentials received from ACS credentials refresh payload at the time of task deletion. The previous expired credentials still live in the credential manager? |
Seems so, we are not doing credentials clean up based on credential expiration time. |
ac0520c
to
cdfc4de
Compare
cdfc4de
to
6732727
Compare
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.
minor comment, changes lgtm
… credential manager
6732727
to
f52f391
Compare
Wait for the release is done to merge --- this is not in the planned release content. |
Summary
Fix a issue that agent does not clean task execution credentials from credential manager when stopping a task
Implementation details
Introducing task execution credential removal to cleanupTask method
Testing
make test
Tested with an al2 instance, stop task with taskExecutionRole seems working fine.
Verify if this is related to memory leak issue: tried with a service of which the task definition makes task exits immediately. (run exit in command) and set desired task count to be 10 and run for about 48h. Both instances start with about the same memory usage (13MiB/31.15GiB)
Result
Using dev branch
Using branch with fix
delta is about 18MiB.
The result shows that this issue is a very minor contributing factor to agent memory leak issue. More research on the memory leak issue will be done based on #3001
New tests cover the changes: yes
Description for the changelog
Fix a issue that agent does not clean task execution credentials from credential manager when stopping a task
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.