diff --git a/VERSION-openeuler b/VERSION-openeuler index 750462b8f56ca3b7d4b0c7f61400fcde5a425dae..b8ef10147e5d0ec8892379a8274d5b701d82159b 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -18.09.0.209 +18.09.0.210 diff --git a/docker-engine-openeuler.spec b/docker-engine-openeuler.spec index 2911919064fb8df87a0a945f505a2013e8c37693..5baae201b6321874b9b5a775a7536d191e382253 100644 --- a/docker-engine-openeuler.spec +++ b/docker-engine-openeuler.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 209 +Release: 210 Summary: The open-source application container engine Group: Tools/Docker @@ -201,6 +201,12 @@ fi %endif %changelog +* Mon Mar 7 2022 chenjiankun - 18.09.0-210 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix docker kill command block + * Thu Mar 4 2022 chenjiankun - 18.09.0-209 - Type:bugfix - ID:NA diff --git a/patch/0198-docker-fix-docker-kill-command-block.patch b/patch/0198-docker-fix-docker-kill-command-block.patch new file mode 100644 index 0000000000000000000000000000000000000000..326f2742303a588c1d01028f6c5ac56d85f5e381 --- /dev/null +++ b/patch/0198-docker-fix-docker-kill-command-block.patch @@ -0,0 +1,81 @@ +From 74bd1d0c00c53f96696663e45507e332684dac7a Mon Sep 17 00:00:00 2001 +From: xiadanni +Date: Wed, 3 Mar 2021 16:46:50 +0800 +Subject: [PATCH] docker: fix docker kill command block + +reason:When docker kill command execute with start/restart command +concurrently, kill command may block at <-container.Wait. +As s.waitStop is variable, so there is case that waitStop in Wait +function get a new s.waitStop(the old one is already closed before). +So kill command blocked to wait the new s.waitStop close. + +Signed-off-by: xiadanni +--- + components/engine/container/state.go | 13 +++++++++++-- + components/engine/daemon/kill.go | 4 +++- + 2 files changed, 14 insertions(+), 3 deletions(-) + +diff --git a/components/engine/container/state.go b/components/engine/container/state.go +index 91ea30a..e9666ed 100644 +--- a/components/engine/container/state.go ++++ b/components/engine/container/state.go +@@ -65,6 +65,10 @@ func NewState() *State { + } + } + ++func (s State) GetWaitStop() chan struct{} { ++ return s.waitStop ++} ++ + // String returns a human-readable description of the state + func (s *State) String() string { + if s.Running { +@@ -179,6 +183,10 @@ const ( + // otherwise, the results Err() method will return an error indicating why the + // wait operation failed. + func (s *State) Wait(ctx context.Context, condition WaitCondition) <-chan StateStatus { ++ return s.Wait3(ctx, condition, nil) ++} ++ ++func (s *State) Wait3(ctx context.Context, condition WaitCondition, waitStop chan struct{}) <-chan StateStatus { + s.Lock() + defer s.Unlock() + +@@ -197,9 +205,10 @@ func (s *State) Wait(ctx context.Context, condition WaitCondition) <-chan StateS + + // If we are waiting only for removal, the waitStop channel should + // remain nil and block forever. +- var waitStop chan struct{} + if condition < WaitConditionRemoved { +- waitStop = s.waitStop ++ if waitStop == nil { ++ waitStop = s.waitStop ++ } + } + + // Always wait for removal, just in case the container gets removed +diff --git a/components/engine/daemon/kill.go b/components/engine/daemon/kill.go +index d185065..4c8ccf9 100644 +--- a/components/engine/daemon/kill.go ++++ b/components/engine/daemon/kill.go +@@ -132,6 +132,8 @@ func (daemon *Daemon) Kill(container *containerpkg.Container) error { + return nil + } + ++ waitStop := container.GetWaitStop() ++ + // 1. Send SIGKILL + if err := daemon.killPossiblyDeadProcess(container, int(syscall.SIGKILL)); err != nil { + // While normally we might "return err" here we're not going to +@@ -166,7 +168,7 @@ func (daemon *Daemon) Kill(container *containerpkg.Container) error { + + // Wait for exit with no timeout. + // Ignore returned status. +- <-container.Wait(context.Background(), containerpkg.WaitConditionNotRunning) ++ <-container.Wait3(context.Background(), containerpkg.WaitConditionNotRunning, waitStop) + + return nil + } +-- +1.8.3.1 + diff --git a/series.conf b/series.conf index f7622b1eae384663180cd7450f4064f3264c57c6..d45974b1e6ba6d997abd2466674efbcdcbac19d5 100644 --- a/series.conf +++ b/series.conf @@ -191,4 +191,5 @@ 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 +patch/0198-docker-fix-docker-kill-command-block.patch #end