Skip to content

Commit fa52f78

Browse files
committed
cli: container: remove logging in wait-for-exit paths
Because these paths are used for detached cases, you can end up seeing "errors" due to not being able to get the exit code, when in reality the context is timing our or being cancelled. I'm not sure how common this is on x86, but I can see it all the time on arm64 -- and these error messages seem quite noisy to me. Signed-off-by: Aleksa Sarai <asarai@suse.de>
1 parent 81ac432 commit fa52f78

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

cli/command/container/utils.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/docker/docker/api/types/events"
1111
"github.com/docker/docker/api/types/filters"
1212
"github.com/docker/docker/api/types/versions"
13-
"github.com/sirupsen/logrus"
1413
)
1514

1615
func waitExitOrRemoved(ctx context.Context, dockerCli command.Cli, containerID string, waitRemove bool) <-chan int {
@@ -38,13 +37,11 @@ func waitExitOrRemoved(ctx context.Context, dockerCli command.Cli, containerID s
3837
select {
3938
case result := <-resultC:
4039
if result.Error != nil {
41-
logrus.Errorf("Error waiting for container: %v", result.Error.Message)
4240
statusC <- 125
4341
} else {
4442
statusC <- int(result.StatusCode)
4543
}
4644
case err := <-errC:
47-
logrus.Errorf("error waiting for container: %v", err)
4845
statusC <- 125
4946
}
5047
}()
@@ -73,9 +70,7 @@ func legacyWaitExitOrRemoved(ctx context.Context, dockerCli command.Cli, contain
7370
case "die":
7471
if v, ok := e.Actor.Attributes["exitCode"]; ok {
7572
code, cerr := strconv.Atoi(v)
76-
if cerr != nil {
77-
logrus.Errorf("failed to convert exitcode '%q' to int: %v", v, cerr)
78-
} else {
73+
if cerr == nil {
7974
exitCode = code
8075
}
8176
}
@@ -88,7 +83,6 @@ func legacyWaitExitOrRemoved(ctx context.Context, dockerCli command.Cli, contain
8883
go func() {
8984
removeErr = dockerCli.Client().ContainerRemove(ctx, containerID, types.ContainerRemoveOptions{RemoveVolumes: true})
9085
if removeErr != nil {
91-
logrus.Errorf("error removing container: %v", removeErr)
9286
cancel() // cancel the event Q
9387
}
9488
}()
@@ -120,7 +114,6 @@ func legacyWaitExitOrRemoved(ctx context.Context, dockerCli command.Cli, contain
120114
return
121115
}
122116
case err := <-errq:
123-
logrus.Errorf("error getting events from daemon: %v", err)
124117
return
125118
}
126119
}

0 commit comments

Comments
 (0)