Repository navigation
cmd: workaround conpty race condition in Start() - #2923
mcayland-ntx wants to merge 1 commit into
Conversation
|
Ping? Justin (@jterry75) is this something that you could help with? Or at least approve the CI run so we can make sure that nothing breaks :) |
|
Code seems harmless. Do you have a link to the conpty bug? I'd like it in the comments at least. |
|
Running checks now to get get some coverage for ya, but I'd still like the comment before merge. |
I don't believe there is an official bug for it? However the behaviour has been reported elsewhere by other conpty users as per my comment in #2831 (comment), and in addition that same issue is referenced by moby who are also seeing similar problems. |
I've had some emails over the weekend indicating that the CI Actions have expired. Looks like I can't manually re-run them without re-pushing... |
conpty has a known race condition when attaching a terminal to a starting process that does not have a Stdin handle, causing the process to exit immediately with a 0xc000013a (STATUS_CONTROL_C_EXIT) error. This is easily noticed when launching a container using nerdctl in detached terminal mode which uses BinaryIO where only the Stdout and Stderr handles are created for the target process. Attempting to start a target process in this configuration results in a process start success rate of less than 5%. Since the race condition in conpty is unlikely to be fixed in the short term, add a workaround to ensure that a Stdin handle is always created for container processes launched with terminal mode enabled. This allows a container started using nerdctl in detached terminal mode to always start successfully. Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
f2ec7be to
49e41ff
Compare
|
LGTM. Harsh Rawat (@rawahars) - LMK when you have taken a look. Ty |
conpty has a known race condition when attaching a terminal to a starting process that does not have a Stdin handle, causing the process to exit immediately with a 0xc000013a (STATUS_CONTROL_C_EXIT) error. This is easily noticed when launching a container using nerdctl in detached terminal mode which uses BinaryIO where only the Stdout and Stderr handles are created for the target process. Attempting to start a target process in this configuration results in a process start success rate of less than 5%.
Since the race condition in conpty is unlikely to be fixed in the short term, add a workaround to ensure that a Stdin handle is always created for container processes launched with terminal mode enabled. This allows a container started using nerdctl in detached terminal mode to always start successfully.
Resolves #2831