[release/1.6 backport] Add cleanup package for context management during cleanup#8822
[release/1.6 backport] Add cleanup package for context management during cleanup#8822thaJeztah wants to merge 4 commits intocontainerd:release/1.6from
Conversation
|
Skipping CI for Draft Pull Request. |
6ad4c4f to
f887aa0
Compare
|
Timestamps / timing and Windows.. always fun. Guess this is a flaky test that may need to be adjusted to be a bit more relaxed; |
|
Good news; looks like there's a PR on main that we can cherry-pick; |
…tchErr This code did not call "abort" on ctx.Cancel() and fetchErr before commit 8017daa https://github.com/containerd/containerd/blob/030c1ac1caa49f88cd572a43a053fb3b7007f94b/unpacker.go#L215-L241 But after the code was moved to pkg/unpacker, abort calls were added; https://github.com/containerd/containerd/blob/8017daa12dd4159e90701bedd1caaa9be5fb0357/pkg/unpack/unpacker.go#L353-L381 That code is not part of the 1.6 branch, so applying it here. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Derek McGowan <[email protected]> (cherry picked from commit 0bc9f7b) Signed-off-by: Sebastiaan van Stijn <[email protected]>
Provides a couple helper functions that provide a background context for running cleanup jobs while preserving the original context values. The new contexts will not inherit the errors or cancellations. Signed-off-by: Derek McGowan <[email protected]> (cherry picked from commit f606c4e) Signed-off-by: Sebastiaan van Stijn <[email protected]>
Use the cleanup context to re-use values from the original context Signed-off-by: Derek McGowan <[email protected]> (cherry picked from commit b550526) Signed-off-by: Sebastiaan van Stijn <[email protected]>
f887aa0 to
3d274f2
Compare
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
This PR is stale because it has been open 90 days with no activity. This PR will be closed in 7 days unless new comments are made or the stale label is removed. |
|
This PR was closed because it has been stalled for 7 days with no activity. |
[release/1.6] client.newUnpacker: call abort() on ctx.Cancel() and fetchErr
This code did not call "abort" on ctx.Cancel() and fetchErr before
commit 8017daa
containerd/unpacker.go
Lines 215 to 241 in 030c1ac
But after the code was moved to pkg/unpacker, abort calls were added;
containerd/pkg/unpack/unpacker.go
Lines 353 to 381 in 8017daa
That code is not part of the 1.6 branch, so applying it here.
and backport of
Conflicts:
I applied the pkg/unpack/unpacker.go changes to
/unpacker.goinsteadI also noticed that not all calls to
cleanupAfterDeadShimusecleanup.Background(not sure if that's intentional?)I'll keep this one in draft for now, perhaps @dmcgowan should have a look