-
Notifications
You must be signed in to change notification settings - Fork 617
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 the memory leak in event handler #967
Conversation
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.
LGTM
CHANGELOG.md
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
## UNRELEASED | |||
* Feature - Support for provisioning Tasks with ENIs | |||
* Bug - Fixed an memory leak issue |
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.
Can you please add more details here? "Fixed a memory leak issue when ..."
agent/eventhandler/task_handler.go
Outdated
// Prepares a given event to be sent by adding it to the handler's appropriate | ||
// eventList | ||
// addEvent prepares a given event to be sent by adding it to the handler's appropriate | ||
// eventList and remove the entry in tasksToEvents map | ||
func (handler *TaskHandler) addEvent(change *sendableEvent, client api.ECSClient) { | ||
seelog.Info("TaskHandler, Adding event: ", change) |
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.
Can you move this below the taskHandlerLock
statements? Also, you can change it to use Infof
while you're here.
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.
just @aaithal's comment about moving the log line below the lock. otherwise lgtm.
6224c39
to
bc33c22
Compare
Summary
fix the memory leak in event handler, #798
Implementation details
Remove the entry in the map after calling sumbitstatechange.
Testing
make release
)go build -out amazon-ecs-agent.exe ./agent
)make test
) passgo test -timeout=25s ./agent/...
) passmake run-integ-tests
) pass.\scripts\run-integ-tests.ps1
) passmake run-functional-tests
) pass.\scripts\run-functional-tests.ps1
) passNew tests cover the changes:
yes
Description for the changelog
Licensing
This contribution is under the terms of the Apache 2.0 License:
yes