From f4b7deed869e58012d2ca8d65dec0ec23d605524 Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Thu, 29 Jun 2023 15:30:58 +0800 Subject: [PATCH] docker: fix blockThreshold full bug Reference:https://github.com/moby/moby/commit/dcfe23a0381da232eb427f8616abd8949fb9693e (cherry picked from commit 0a4d9fd935beba53895f650ab233538f15f579db) --- VERSION-vendor | 2 +- docker-engine-openeuler.spec | 8 +++- ...backport-fix-blockThreshold-full-bug.patch | 46 +++++++++++++++++++ series.conf | 1 + 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 patch/0259-backport-fix-blockThreshold-full-bug.patch diff --git a/VERSION-vendor b/VERSION-vendor index 2712b77..3ac6e00 100644 --- a/VERSION-vendor +++ b/VERSION-vendor @@ -1 +1 @@ -18.09.0.254 +18.09.0.255 diff --git a/docker-engine-openeuler.spec b/docker-engine-openeuler.spec index bfdfc63..5fe715d 100644 --- a/docker-engine-openeuler.spec +++ b/docker-engine-openeuler.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 254 +Release: 255 Epoch: 1 Summary: The open-source application container engine Group: Tools/Docker @@ -199,6 +199,12 @@ fi %endif %changelog +* Tue Jun 27 2023 chenjiankun - 18.09.0-255 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix blockThreshold full bug + * Thu Jun 08 2023 zhongjiawei - 18.09.0-254 - Type:bugfix - CVE:NA diff --git a/patch/0259-backport-fix-blockThreshold-full-bug.patch b/patch/0259-backport-fix-blockThreshold-full-bug.patch new file mode 100644 index 0000000..7a8d507 --- /dev/null +++ b/patch/0259-backport-fix-blockThreshold-full-bug.patch @@ -0,0 +1,46 @@ +From dcfe23a0381da232eb427f8616abd8949fb9693e Mon Sep 17 00:00:00 2001 +From: ningmingxiao +Date: Thu, 30 Dec 2021 23:10:48 +0800 +Subject: [PATCH] fix blockThreshold full bug + +Signed-off-by: ningmingxiao + +--- + components/engine/pkg/ioutils/bytespipe.go | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/components/engine/pkg/ioutils/bytespipe.go b/components/engine/pkg/ioutils/bytespipe.go +index d4bbf3c9..e04a5bf5 100644 +--- a/components/engine/pkg/ioutils/bytespipe.go ++++ b/components/engine/pkg/ioutils/bytespipe.go +@@ -34,6 +34,7 @@ type BytesPipe struct { + buf []*fixedBuffer + bufLen int + closeErr error // error to return from next Read. set to nil if not closed. ++ readBlock bool // check read BytesPipe is Wait() or not + } + + // NewBytesPipe creates new BytesPipe, initialized by specified slice. +@@ -86,6 +87,9 @@ loop0: + + // make sure the buffer doesn't grow too big from this write + for bp.bufLen >= blockThreshold { ++ if bp.readBlock { ++ bp.wait.Broadcast() ++ } + bp.wait.Wait() + if bp.closeErr != nil { + continue loop0 +@@ -131,7 +135,9 @@ func (bp *BytesPipe) Read(p []byte) (n int, err error) { + bp.mu.Unlock() + return 0, bp.closeErr + } ++ bp.readBlock = true + bp.wait.Wait() ++ bp.readBlock = false + if bp.bufLen == 0 && bp.closeErr != nil { + err := bp.closeErr + bp.mu.Unlock() +-- +2.23.0 + diff --git a/series.conf b/series.conf index e2be4e1..14b40f9 100644 --- a/series.conf +++ b/series.conf @@ -247,4 +247,5 @@ patch/0255-docker-libnet-d-overlay-extract-VNI-match-rule-builder.patch patch/0256-docker-libnet-d-overlay-document-some-encryption-code.patch patch/0257-docker-libnet-d-overlay-add-BPF-powered-VNI-matcher.patch patch/0258-docker-thinpool-full-because-kill-docker-daemon-when.patch +patch/0259-backport-fix-blockThreshold-full-bug.patch #end