summaryrefslogtreecommitdiff
path: root/libpod/oci_conmon_exec_linux.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2021-07-12 17:17:47 -0400
committerMatthew Heon <mheon@redhat.com>2021-07-13 16:26:53 -0400
commitcbbb1a80f5ccbbec5496f253cabce0f65df0f656 (patch)
treec82b917962d0cbee84d3f9a988cb67bd9a8d1faf /libpod/oci_conmon_exec_linux.go
parent31c3b952e5da7eb11a32464a0cd74856265efec5 (diff)
downloadpodman-cbbb1a80f5ccbbec5496f253cabce0f65df0f656.tar.gz
podman-cbbb1a80f5ccbbec5496f253cabce0f65df0f656.tar.bz2
podman-cbbb1a80f5ccbbec5496f253cabce0f65df0f656.zip
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 <mheon@redhat.com>
Diffstat (limited to 'libpod/oci_conmon_exec_linux.go')
-rw-r--r--libpod/oci_conmon_exec_linux.go3
1 files changed, 3 insertions, 0 deletions
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)
+ }
}()
}