Skip to content

daemon/export: Stop when context is canceled #49265

Merged
thaJeztah merged 1 commit intomoby:masterfrom
vvoland:export-ctx-cancellation
Jan 13, 2025
Merged

daemon/export: Stop when context is canceled #49265
thaJeztah merged 1 commit intomoby:masterfrom
vvoland:export-ctx-cancellation

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Jan 13, 2025

Close archive when context is done - this makes the cancellation actually stop the export instead of continuing it regardless if the client still expects the data.

- How to verify it

1. Call `docker events`
2. Start `docker export ...` on a large container
3. Ctrl+C the export

Before this PR, the export would finish and container export event would be emitted.
After this PR, the event is not emitted and the dockerd logs show that operation ended with "canceled" error.

- Description for the changelog

Fix `docker export` continuing the export after the operation was canceled

- A picture of a cute animal (not mandatory but encouraged)

@vvoland vvoland added this to the 28.0.0 milestone Jan 13, 2025
@vvoland vvoland self-assigned this Jan 13, 2025
@vvoland vvoland force-pushed the export-ctx-cancellation branch from 099762b to e4608fe Compare January 13, 2025 15:07
@vvoland vvoland marked this pull request as ready for review January 13, 2025 15:21
Close archive when context is done - this makes the cancellation
actually stop the export instead of continuing it regardless if the
client still expects the data.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland force-pushed the export-ctx-cancellation branch from e4608fe to 5a6a980 Compare January 13, 2025 15:34
@vvoland vvoland mentioned this pull request Jan 13, 2025
2 tasks
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@thaJeztah thaJeztah merged commit 22d3a32 into moby:master Jan 13, 2025
140 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants