diff --git a/VERSION-openeuler b/VERSION-openeuler index 5f292c2cd9c525bca91f4bee2a3665c873cddbfc..750462b8f56ca3b7d4b0c7f61400fcde5a425dae 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -18.09.0.208 +18.09.0.209 diff --git a/docker-engine-openeuler.spec b/docker-engine-openeuler.spec index 1a8ffc99be2596e93184c02c661a12513c031b6b..2911919064fb8df87a0a945f505a2013e8c37693 100644 --- a/docker-engine-openeuler.spec +++ b/docker-engine-openeuler.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 207 +Release: 209 Summary: The open-source application container engine Group: Tools/Docker @@ -201,7 +201,13 @@ fi %endif %changelog -* Thu Mar 3 2022 chenjiankun - 18.09.0-207 +* Thu Mar 4 2022 chenjiankun - 18.09.0-209 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix hijack hang + +* Thu Mar 3 2022 chenjiankun - 18.09.0-208 - Type:bugfix - ID:NA - SUG:NA diff --git a/patch/0197-docker-fix-hijack-hang.patch b/patch/0197-docker-fix-hijack-hang.patch new file mode 100644 index 0000000000000000000000000000000000000000..335762abf2a0bedecc9864e0e3e70db053accad5 --- /dev/null +++ b/patch/0197-docker-fix-hijack-hang.patch @@ -0,0 +1,51 @@ +From 06e9b3151585573818df8d890c0be1dc576500e6 Mon Sep 17 00:00:00 2001 +From: jingrui +Date: Mon, 1 Feb 2021 16:56:40 +0800 +Subject: [PATCH] docker: fix hijack hang + +Change-Id: Ica0fe7806227114acfe028b44dfeed70a5dd4577 +Signed-off-by: jingrui +--- + .../docker/docker/client/container_exec.go | 18 ++++++++- + .../dockerd/hack/malformed_host_override.go | 37 +++++++++++-------- + 2 files changed, 38 insertions(+), 17 deletions(-) + +diff --git a/components/cli/vendor/github.com/docker/docker/client/container_exec.go b/components/cli/vendor/github.com/docker/docker/client/container_exec.go +index 535536b1e0..ac458e9c30 100644 +--- a/components/cli/vendor/github.com/docker/docker/client/container_exec.go ++++ b/components/cli/vendor/github.com/docker/docker/client/container_exec.go +@@ -3,6 +3,8 @@ package client // import "github.com/docker/docker/client" + import ( + "context" + "encoding/json" ++ "fmt" ++ "time" + + "github.com/docker/docker/api/types" + ) +@@ -36,8 +38,20 @@ func (cli *Client) ContainerExecStart(ctx context.Context, execID string, config + // and the a reader to get output. It's up to the called to close + // the hijacked connection by calling types.HijackedResponse.Close. + func (cli *Client) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) { +- headers := map[string][]string{"Content-Type": {"application/json"}} +- return cli.postHijacked(ctx, "/exec/"+execID+"/start", nil, config, headers) ++ done := make(chan struct{}) ++ var resp types.HijackedResponse ++ var err error ++ go func() { ++ headers := map[string][]string{"Content-Type": {"application/json"}} ++ resp, err = cli.postHijacked(ctx, "/exec/"+execID+"/start", nil, config, headers) ++ close(done) ++ }() ++ select { ++ case <-done: ++ return resp, err ++ case <-time.After(5 * time.Minute): ++ return resp, fmt.Errorf("post exec hijacked timeout") ++ } + } + + // ContainerExecInspect returns information about a specific exec process on the docker host. +-- +2.17.1 + diff --git a/series.conf b/series.conf index be9247f61be8a8c767fb94a65375cea95c36d560..f7622b1eae384663180cd7450f4064f3264c57c6 100644 --- a/series.conf +++ b/series.conf @@ -190,4 +190,5 @@ patch/0193-docker-fix-images-filter-when-use-multi-reference.patch patch/0194-docker-fix-docker-rmi-stucking.patch patch/0195-docker-fix-network-sandbox-not-cleaned-up-on-failure.patch patch/0196-docker-fix-container-status-not-consistent-with-its-.patch +patch/0197-docker-fix-hijack-hang.patch #end