From cbbb1a80f5ccbbec5496f253cabce0f65df0f656 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Mon, 12 Jul 2021 17:17:47 -0400 Subject: Perform a one-sided close of HTTP attach conn on EOF On EOF of STDIN, we need to perform a one-sided close of the attach connection on the client side, to ensure that STDIN finishing will also cause the exec session to terminate, instead of hang. Fixes #7360 Signed-off-by: Matthew Heon --- libpod/oci_conmon_exec_linux.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libpod/oci_conmon_exec_linux.go') diff --git a/libpod/oci_conmon_exec_linux.go b/libpod/oci_conmon_exec_linux.go index 09d3d1833..05a4e19b0 100644 --- a/libpod/oci_conmon_exec_linux.go +++ b/libpod/oci_conmon_exec_linux.go @@ -610,6 +610,9 @@ func attachExecHTTP(c *Container, sessionID string, r *http.Request, w http.Resp _, err := utils.CopyDetachable(conn, httpBuf, detachKeys) logrus.Debugf("STDIN copy completed") stdinChan <- err + if connErr := conn.CloseWrite(); connErr != nil { + logrus.Errorf("Unable to close conn: %v", connErr) + } }() } -- cgit v1.2.3-54-g00ecf