38 lines
1.4 KiB
Diff
38 lines
1.4 KiB
Diff
From e2e670299f83699094c28add5a4366749d9bd34c Mon Sep 17 00:00:00 2001
|
|
From: Brian Goff <cpuguy83@gmail.com>
|
|
Date: Mon, 1 Apr 2024 21:30:43 +0000
|
|
Subject: Fix cases where we are wrapping a nil error
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
This was using `errors.Wrap` when there was no error to wrap, meanwhile
|
|
we are supposed to be creating a new error.
|
|
|
|
Found this while investigating some log corruption issues and
|
|
unexpectedly getting a nil reader and a nil error from `getTailReader`.
|
|
|
|
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
|
|
(cherry picked from commit 0a48d26fbcb33a84da7f767c2a62cae362df9505)
|
|
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
|
|
---
|
|
daemon/logger/local/read.go | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/daemon/logger/local/read.go b/daemon/logger/local/read.go
|
|
index 6a0b166103..cb5f9f0cd3 100644
|
|
--- a/daemon/logger/local/read.go
|
|
+++ b/daemon/logger/local/read.go
|
|
@@ -66,7 +66,7 @@ func getTailReader(ctx context.Context, r loggerutils.SizeReaderAt, req int) (io
|
|
}
|
|
|
|
if msgLen != binary.BigEndian.Uint32(buf) {
|
|
- return nil, 0, errdefs.DataLoss(errors.Wrap(err, "log message header and footer indicate different message sizes"))
|
|
+ return nil, 0, errdefs.DataLoss(errors.New("log message header and footer indicate different message sizes"))
|
|
}
|
|
|
|
found++
|
|
--
|
|
2.27.0
|
|
|