36935bd869
Closing stdin of a container or exec (a.k.a.: task or process) has been somewhat broken ever since support for ContainerD 1.0 was introduced back in Docker v17.11: the error returned from the CloseIO() call was effectively ignored due to it being assigned to a local variable which shadowed the intended variable. Serendipitously, that oversight prevented a data race. In my recent refactor of libcontainerd, I corrected the variable shadowing issue and introduced the aforementioned data race in the process. Avoid deadlocking when closing stdin without swallowing errors or introducing data races by calling CloseIO() synchronously if the process handle is available, falling back to an asynchronous close-and-log strategy otherwise. This solution is inelegant and complex, but looks to be the best that could be done without changing the libcontainerd API. Signed-off-by: Cory Snider <csnider@mirantis.com> |
||
---|---|---|
.. | ||
client.go | ||
client_io_windows.go | ||
client_linux.go | ||
client_windows.go |