diff --git a/VERSION-openeuler b/VERSION-openeuler index a5d9c1a1acbcdd066a060bc08a9f6fe42cbb7cdc..08856f67626061dfa5fd1108af6d735e3ae46ecd 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -18.09.0.239 +18.09.0.240 diff --git a/docker-engine-openeuler.spec b/docker-engine-openeuler.spec index 20a55507ff53e404a9cc9a9dc430e4e6fa4501ac..76cb6cc865123e744e4a074789e32add1e0c7f2c 100644 --- a/docker-engine-openeuler.spec +++ b/docker-engine-openeuler.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 239 +Release: 240 Summary: The open-source application container engine Group: Tools/Docker @@ -198,6 +198,12 @@ fi %endif %changelog +* Thu Sep 15 2022 chenjiankun - 18.09.0-240 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:Add an ExitPid field for State struct to record exit process id + * Thu Sep 15 2022 chenjiankun - 18.09.0-239 - Type:bugfix - CVE:NA diff --git a/patch/0229-docker-Add-an-ExitPid-field-for-State-struct-to-reco.patch b/patch/0229-docker-Add-an-ExitPid-field-for-State-struct-to-reco.patch new file mode 100644 index 0000000000000000000000000000000000000000..a72cb14e3f4cbc0b3a4b31a0b495dca3fe7f0dc5 --- /dev/null +++ b/patch/0229-docker-Add-an-ExitPid-field-for-State-struct-to-reco.patch @@ -0,0 +1,48 @@ +From ebe1a56fb28e7de7128167973a99061e6aa0222a Mon Sep 17 00:00:00 2001 +From: chenjiankun +Date: Thu, 7 Jul 2022 10:18:03 +0800 +Subject: [PATCH] docker: Add an ExitPid field for State struct to record exit + process id + +--- + components/engine/container/state.go | 1 + + components/engine/daemon/monitor.go | 4 ++++ + 2 files changed, 5 insertions(+) + +diff --git a/components/engine/container/state.go b/components/engine/container/state.go +index da19cc49e..292b0ec0b 100644 +--- a/components/engine/container/state.go ++++ b/components/engine/container/state.go +@@ -27,6 +27,7 @@ type State struct { + RemovalInProgress bool // Not need for this to be persistent on disk. + Dead bool + Pid int ++ ExitPid uint32 // record exit process id. + ExitCodeValue int `json:"ExitCode"` + ErrorMsg string `json:"Error"` // contains last known error during container start, stop, or remove + StartedAt time.Time +diff --git a/components/engine/daemon/monitor.go b/components/engine/daemon/monitor.go +index a5c7ff5c8..89c05f3da 100644 +--- a/components/engine/daemon/monitor.go ++++ b/components/engine/daemon/monitor.go +@@ -57,6 +57,7 @@ func (daemon *Daemon) ProcessEvent(id string, e libcontainerd.EventType, ei libc + + daemon.LogContainerEvent(c, "oom") + case libcontainerd.EventExit: ++ c.ExitPid = ei.Pid + if int(ei.Pid) == c.Pid { + logrus.Infof("handle container %s exit event pid=%d", c.ID, c.Pid) + c.Lock() +@@ -169,6 +170,9 @@ func (daemon *Daemon) ProcessEvent(id string, e libcontainerd.EventType, ei libc + + // This is here to handle start not generated by docker + if !c.Running { ++ if c.ExitPid == ei.Pid && time.Now().UTC().Sub(c.FinishedAt).Seconds() < 3 { ++ return nil ++ } + c.SetRunning(int(ei.Pid), false) + c.HasBeenManuallyStopped = false + c.HasBeenStartedBefore = true +-- +2.23.0 + diff --git a/series.conf b/series.conf index d2c4c238e39d959116704f79d931dae2da243c8e..5722e48b74dabf432f629026944622010c027f14 100644 --- a/series.conf +++ b/series.conf @@ -222,4 +222,5 @@ patch/0225-docker-chrootarchive-don-t-create-parent-dirs-outside-of-ch.patch patch/0226-docker-Lock-down-docker-root-dir-perms.patch patch/0227-docker-registry-ensure-default-auth-config-has-address.patch patch/0228-docker-fix-terminal-abnormal-after-docker-run.patch +patch/0229-docker-Add-an-ExitPid-field-for-State-struct-to-reco.patch #end