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

Fix potential nil pointer dereference #2578

Merged
merged 1 commit into from
Aug 19, 2020
Merged

Fix potential nil pointer dereference #2578

merged 1 commit into from
Aug 19, 2020

Conversation

fenxiong
Copy link
Contributor

@fenxiong fenxiong commented Aug 18, 2020

Summary

Currently, query container stats endpoint right after container starts trigger a panic (and as a result empty response for the endpoint), due to taskStats.StatsQueue.GetLastStat() is nil when task just starts. This PR fixes it.

Implementation details

Added nil pointer check.

Testing

Manually tested the mentioned case and verified the fix.

Description for the changelog

Bug - Fixed a bug that can cause stats endpoint to return empty response to container that just starts up.

Licensing

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

@fenxiong fenxiong merged commit a21516a into aws:dev Aug 19, 2020
@fenxiong fenxiong deleted the stats-npe branch August 19, 2020 20:07
@fenxiong fenxiong added this to the 1.45.0 milestone Aug 19, 2020
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