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

progress: fix clean context cancelling #3443

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

tonistiigi
Copy link
Member

@sipsma I'm not sure if this is best solution so feel free to open an alternative but discovered that the current state is not quite correct.

When case <-ctx.Done(): gets called it doesn't return out of the function but sets onFinalStatus to return after iteration. But then it calls manager.Status(ctx that is guaranteed to error because we already know that the context is closed. Because the error handling is relaxed it doesn't error the function but still logs error message every time.

Signed-off-by: Tonis Tiigi [email protected]

@@ -106,6 +106,7 @@ func trackProgress(ctx context.Context, desc ocispecs.Descriptor, manager PullMa
select {
case <-ctx.Done():
onFinalStatus = true
ctx = context.TODO()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment line to explain this?

@tonistiigi tonistiigi merged commit ba01b54 into moby:master Jan 6, 2023
@tonistiigi tonistiigi mentioned this pull request Jan 6, 2023
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.

2 participants