update to 25.0.3

Signed-off-by: shechenglong <shechenglong@xfusion.com>
This commit is contained in:
shechenglong 2024-02-06 19:50:22 +08:00
parent 1d574e399a
commit d7b02acf40
6 changed files with 9 additions and 213 deletions

View File

@ -1,148 +0,0 @@
From ad45ece6fe93c6870080341daa12fe8da6271fa9 Mon Sep 17 00:00:00 2001
From: Wesley Pettit <wppttt@amazon.com>
Date: Wed, 29 Mar 2023 16:09:07 -0700
Subject: [PATCH 451/483] awslogs: fix non-blocking log drop bug
Previously, the AWSLogs driver attempted to implement
non-blocking itself. Non-blocking is supposed to
implemented solely by the Docker RingBuffer that
wraps the log driver.
Please see issue and explanation here:
https://github.com/moby/moby/issues/45217
Signed-off-by: Wesley Pettit <wppttt@amazon.com>
(cherry picked from commit c8f8d11ac42c16be9779565093e6a45bcf1a3b7b)
---
daemon/logger/awslogs/cloudwatchlogs.go | 18 ++---------
daemon/logger/awslogs/cloudwatchlogs_test.go | 32 ++------------------
2 files changed, 6 insertions(+), 44 deletions(-)
diff --git a/daemon/logger/awslogs/cloudwatchlogs.go b/daemon/logger/awslogs/cloudwatchlogs.go
index acaf261c93..5ceb0c913f 100644
--- a/daemon/logger/awslogs/cloudwatchlogs.go
+++ b/daemon/logger/awslogs/cloudwatchlogs.go
@@ -71,7 +71,6 @@ type logStream struct {
logStreamName string
logGroupName string
logCreateGroup bool
- logNonBlocking bool
forceFlushInterval time.Duration
multilinePattern *regexp.Regexp
client api
@@ -85,7 +84,6 @@ type logStreamConfig struct {
logStreamName string
logGroupName string
logCreateGroup bool
- logNonBlocking bool
forceFlushInterval time.Duration
maxBufferedEvents int
multilinePattern *regexp.Regexp
@@ -147,11 +145,12 @@ func New(info logger.Info) (logger.Logger, error) {
return nil, err
}
+ logNonBlocking := info.Config["mode"] == "non-blocking"
+
containerStream := &logStream{
logStreamName: containerStreamConfig.logStreamName,
logGroupName: containerStreamConfig.logGroupName,
logCreateGroup: containerStreamConfig.logCreateGroup,
- logNonBlocking: containerStreamConfig.logNonBlocking,
forceFlushInterval: containerStreamConfig.forceFlushInterval,
multilinePattern: containerStreamConfig.multilinePattern,
client: client,
@@ -159,7 +158,7 @@ func New(info logger.Info) (logger.Logger, error) {
}
creationDone := make(chan bool)
- if containerStream.logNonBlocking {
+ if logNonBlocking {
go func() {
backoff := 1
maxBackoff := 32
@@ -215,8 +214,6 @@ func newStreamConfig(info logger.Info) (*logStreamConfig, error) {
}
}
- logNonBlocking := info.Config["mode"] == "non-blocking"
-
forceFlushInterval := defaultForceFlushInterval
if info.Config[forceFlushIntervalKey] != "" {
forceFlushIntervalAsInt, err := strconv.Atoi(info.Config[forceFlushIntervalKey])
@@ -247,7 +244,6 @@ func newStreamConfig(info logger.Info) (*logStreamConfig, error) {
logStreamName: logStreamName,
logGroupName: logGroupName,
logCreateGroup: logCreateGroup,
- logNonBlocking: logNonBlocking,
forceFlushInterval: forceFlushInterval,
maxBufferedEvents: maxBufferedEvents,
multilinePattern: multilinePattern,
@@ -412,14 +408,6 @@ func (l *logStream) Log(msg *logger.Message) error {
if l.closed {
return errors.New("awslogs is closed")
}
- if l.logNonBlocking {
- select {
- case l.messages <- msg:
- return nil
- default:
- return errors.New("awslogs buffer is full")
- }
- }
l.messages <- msg
return nil
}
diff --git a/daemon/logger/awslogs/cloudwatchlogs_test.go b/daemon/logger/awslogs/cloudwatchlogs_test.go
index 688a3b5e2f..c5a0788303 100644
--- a/daemon/logger/awslogs/cloudwatchlogs_test.go
+++ b/daemon/logger/awslogs/cloudwatchlogs_test.go
@@ -325,42 +325,16 @@ func TestLogBlocking(t *testing.T) {
}
}
-func TestLogNonBlockingBufferEmpty(t *testing.T) {
+func TestLogBufferEmpty(t *testing.T) {
mockClient := newMockClient()
stream := &logStream{
- client: mockClient,
- messages: make(chan *logger.Message, 1),
- logNonBlocking: true,
+ client: mockClient,
+ messages: make(chan *logger.Message, 1),
}
err := stream.Log(&logger.Message{})
assert.NilError(t, err)
}
-func TestLogNonBlockingBufferFull(t *testing.T) {
- mockClient := newMockClient()
- stream := &logStream{
- client: mockClient,
- messages: make(chan *logger.Message, 1),
- logNonBlocking: true,
- }
- stream.messages <- &logger.Message{}
- errorCh := make(chan error, 1)
- started := make(chan bool)
- go func() {
- started <- true
- err := stream.Log(&logger.Message{})
- errorCh <- err
- }()
- <-started
- select {
- case err := <-errorCh:
- if err == nil {
- t.Fatal("Expected non-nil error")
- }
- case <-time.After(30 * time.Second):
- t.Fatal("Expected Log call to not block")
- }
-}
func TestPublishBatchSuccess(t *testing.T) {
mockClient := newMockClient()
stream := &logStream{
--
2.32.0 (Apple Git-132)

Binary file not shown.

BIN
cli-25.0.3.tar.gz Normal file

Binary file not shown.

View File

@ -1,54 +0,0 @@
From 44152f6fb66da0ade1aa226f0b66ebbaa43d54b1 Mon Sep 17 00:00:00 2001
From: Sebastiaan van Stijn <github@gone.nl>
Date: Fri, 7 Jul 2023 14:54:04 +0200
Subject: [PATCH 478/483] daemon: daemon.prepareMountPoints(): fix panic if
mount is not a volume
The daemon.lazyInitializeVolume() function only handles restoring Volumes
if a Driver is specified. The Container's MountPoints field may also
contain other kind of mounts (e.g., bind-mounts). Those were ignored, and
don't return an error; https://github.com/moby/moby/blob/1d9c8619cded4657af1529779c5771127e8ad0e7/daemon/volumes.go#L243-L252C2
However, the prepareMountPoints() assumed each MountPoint was a volume,
and logged an informational message about the volume being restored;
https://github.com/moby/moby/blob/1d9c8619cded4657af1529779c5771127e8ad0e7/daemon/mounts.go#L18-L25
This would panic if the MountPoint was not a volume;
github.com/docker/docker/daemon.(*Daemon).prepareMountPoints(0xc00054b7b8?, 0xc0007c2500)
/root/rpmbuild/BUILD/src/engine/.gopath/src/github.com/docker/docker/daemon/mounts.go:24 +0x1c0
github.com/docker/docker/daemon.(*Daemon).restore.func5(0xc0007c2500, 0x0?)
/root/rpmbuild/BUILD/src/engine/.gopath/src/github.com/docker/docker/daemon/daemon.go:552 +0x271
created by github.com/docker/docker/daemon.(*Daemon).restore
/root/rpmbuild/BUILD/src/engine/.gopath/src/github.com/docker/docker/daemon/daemon.go:530 +0x8d8
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x564e9be4c7c0]
This issue was introduced in 647c2a6cdd86d79230df1bf690d0b6a2930d6db2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a490248f4d19164d78d3ef4f91cf142c3aad1790)
Signed-off-by: Cory Snider <csnider@mirantis.com>
---
daemon/mounts.go | 4 ++++
1 files changed, 4 insertions(+)
diff --git a/daemon/mounts.go b/daemon/mounts.go
index 424e375037..3c79b0d447 100644
--- a/daemon/mounts.go
+++ b/daemon/mounts.go
@@ -15,6 +15,10 @@ func (daemon *Daemon) prepareMountPoints(container *container.Container) error {
if err := daemon.lazyInitializeVolume(container.ID, config); err != nil {
return err
}
+ if config.Volume == nil {
+ // FIXME(thaJeztah): should we check for config.Type here as well? (i.e., skip bind-mounts etc)
+ continue
+ }
}
return nil
}
--
2.32.0 (Apple Git-132)

BIN
moby-20.10.24.tar.gz → moby-25.0.3.tar.gz Executable file → Normal file

Binary file not shown.

View File

@ -1,28 +1,25 @@
%global _gitcommit_engine 5d6db84
%global _gitcommit_cli 297e128
%global _gitcommit_engine f417435
%global _gitcommit_cli 4debf41
%global _source_engine moby-%{version}
%global _source_client cli-%{version}
%global _source_docker_init tini-0.19.0
%define _debugsource_template %{nil}
Name: moby
Version: 20.10.24
Release: 7
Version: 25.0.3
Release: 1
Summary: The open-source application container engine
License: ASL 2.0
URL: https://www.docker.com
# https://github.com/docker/cli/archive/refs/tags/v20.10.24.tar.gz
# https://github.com/docker/cli/archive/refs/tags/v25.0.3.tar.gz
Source0: cli-%{version}.tar.gz
# https://github.com/moby/moby/archive/refs/tags/v20.10.24.tar.gz
# https://github.com/moby/moby/archive/refs/tags/v25.0.3.tar.gz
Source1: moby-%{version}.tar.gz
# https://github.com/krallin/tini/archive/refs/tags/v0.19.0.tar.gz
Source2: tini-0.19.0.tar.gz
Source3: docker.service
Source4: docker.socket
Source5: docker.sysconfig
Patch0000: awslogs-fix-non-blocking-log-drop-bug.patch
Patch0001: daemon-prepare-MountPoints-fix-panic-if-mount.patch
Requires: %{name}-engine = %{version}-%{release}
Requires: %{name}-client = %{version}-%{release}
@ -92,8 +89,6 @@ Docker client binary and related utilities
%prep
%setup -q -n %{_source_client}
%setup -q -T -n %{_source_engine} -b 1
%patch0000 -p1
%patch0001 -p1
%setup -q -T -n %{_source_docker_init} -b 2
%build
@ -195,6 +190,9 @@ fi
%systemd_postun_with_restart docker.service
%changelog
* Tue Feb 06 2024 shechenglong<shechenglong@xfusion.com> - 25.0.3-1
- DESC:update to 25.0.3
* Thu Dec 28 2023 maokecheng<maokecheng@xfusion.com> - 20.10.24-7
- Adapt docker-runc to be changed to runc