From 9b293e92215bcf51a631a98368632fb976263aa6 Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Tue, 27 Jun 2023 16:59:43 +0800 Subject: [PATCH] docker: fix blockThreshold full bug Reference:https://github.com/moby/moby/commit/dcfe23a0381da232eb427f8616abd8949fb9693e --- VERSION-vendor | 2 +- docker.spec | 8 +++- git-commit | 2 +- ...backport-fix-blockThreshold-full-bug.patch | 46 +++++++++++++++++++ series.conf | 1 + 5 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 patch/0259-backport-fix-blockThreshold-full-bug.patch diff --git a/VERSION-vendor b/VERSION-vendor index dfa8e93..64cf6b5 100644 --- a/VERSION-vendor +++ b/VERSION-vendor @@ -1 +1 @@ -18.09.0.324 +18.09.0.325 diff --git a/docker.spec b/docker.spec index 6550a20..8bcf885 100644 --- a/docker.spec +++ b/docker.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 324 +Release: 325 Epoch: 2 Summary: The open-source application container engine Group: Tools/Docker @@ -229,6 +229,12 @@ fi %endif %changelog +* Tue Jun 27 2023 chenjiankun - 18.09.0-325 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix blockThreshold full bug + * Thu Jun 08 2023 zhongjiawei - 18.09.0-324 - Type:bugfix - CVE:NA diff --git a/git-commit b/git-commit index 2104741..9f8649e 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -6e4bf15b8a9b1ee7f1e2ec998e338319f3247148 +67cbcd3bf8881fc8434a3e35e778cbe6791e7727 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 6f32f8a..577c0bb 100644 --- a/series.conf +++ b/series.conf @@ -256,4 +256,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 -- Gitee