Skip to content

progress: fix clean context cancelling#3443

Merged
tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi:progress-cancel
Jan 6, 2023
Merged

progress: fix clean context cancelling#3443
tonistiigi merged 1 commit intomoby:masterfrom
tonistiigi:progress-cancel

Conversation

@tonistiigi
Copy link
Copy Markdown
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 tonistiigi@gmail.com

select {
case <-ctx.Done():
onFinalStatus = true
ctx = context.TODO()
Copy link
Copy Markdown
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?

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@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