Skip to content

[release/1.3 backport] v2: Cancel shim log ctx when ttrpc is closed#4755

Merged
mxpv merged 3 commits intocontainerd:release/1.3from
thaJeztah:1.3_backport_cancel_shim_log_ctx_by_onclose
Dec 11, 2020
Merged

[release/1.3 backport] v2: Cancel shim log ctx when ttrpc is closed#4755
mxpv merged 3 commits intocontainerd:release/1.3from
thaJeztah:1.3_backport_cancel_shim_log_ctx_by_onclose

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

This back ports;

The first two cherry-picks were to get a clean backport, but (from the description) seem good to have

If the context is cancelled during `shim.Create()`, such as the client
disconnects unexpectedly. The created shim will never be deleted.
What's more, if the context is cancelled during `openShimLog()`, the
fifo will be closed and block the shim output.

Signed-off-by: Li Yuxuan <[email protected]>
(cherry picked from commit d82fa43)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Related to
containerd#3921 (comment)

Signed-off-by: Li Yuxuan <[email protected]>
(cherry picked from commit 1fb1d93)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
The background context aovids shim blocking when the ctx is cancelled
unexpectedly during shim start. But if the shim exits unexpectedly
before opening the pipe, the fd will never be closed.
`onCloseWithShimLog` makes sure that the shim log fd is closed properly
once the shim disconnects.

Signed-off-by: Li Yuxuan <[email protected]>
(cherry picked from commit 84464b8)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member Author

@estesp PTAL; I saw you marked this one for backporting 😅 #4046 (comment)

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Nov 19, 2020

Build succeeded.

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@mxpv mxpv merged commit 1e683ff into containerd:release/1.3 Dec 11, 2020
@thaJeztah thaJeztah deleted the 1.3_backport_cancel_shim_log_ctx_by_onclose branch December 11, 2020 19:11
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.

4 participants