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

[release/0.9] Add ErrInvalidHandle and fix list stats #1277

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

dcantah
Copy link
Contributor

@dcantah dcantah commented Jan 13, 2022

When querying the stats of a container that is in the process of being
stopped, an ERROR_INVALID_HANDLE (0x6) may be returned. This change
ignores that error and returns an empty stats object.

This change also fixes the return values of Stats() when encountering
one of the expected errors. Returning nil stats when error is nil will
break caller assumptions of finding a valid value when error is nil.
Instead, an ErrNotFound is returned.

Signed-off-by: Gabriel Adrian Samfira [email protected]
(cherry picked from commit 790bcae)
Signed-off-by: Daniel Canter [email protected]

When querying the stats of a container that is in the process of being
stopped, an ERROR_INVALID_HANDLE (0x6) may be returned. This change
ignores that error and returns an empty stats object.

This change also fixes the return values of Stats() when encountering
one of the expected errors. Returning nil stats when error is nil will
break caller assumptions of finding a valid value when error is nil.
Instead, an ErrNotFound is returned.

Signed-off-by: Gabriel Adrian Samfira <[email protected]>
(cherry picked from commit 790bcae)
Signed-off-by: Daniel Canter <[email protected]>
@dcantah dcantah requested a review from a team as a code owner January 13, 2022 18:48
@dcantah
Copy link
Contributor Author

dcantah commented Jan 13, 2022

fyi @gabriel-samfira @jsturtevant

@dcantah
Copy link
Contributor Author

dcantah commented Jan 13, 2022

This should resolve kubernetes/kubernetes#106278. Reason for it targeted to release/0.9 is that's the hcsshim minor tag number Containerd will be on for 1.6

@dcantah dcantah merged commit fc4f38d into microsoft:release/0.9 Jan 13, 2022
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.

5 participants