Skip to content

build: don't print warning when connection was terminated#49299

Merged
vvoland merged 1 commit intomoby:masterfrom
thaJeztah:build_no_broken_pipe_errs
Jan 20, 2025
Merged

build: don't print warning when connection was terminated#49299
vvoland merged 1 commit intomoby:masterfrom
thaJeztah:build_no_broken_pipe_errs

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

A terminated connection is not an error on the daemon-side, and expected if the client disconnects. This patch detects if the error is because of a broken pipe, and skips the warning in that case.

Before this patch:

WARN[2025-01-18T12:38:04.115298341Z] could not write error response: write unix /var/run/docker.sock->@: write: broken pipe

After this patch, no warning is logged. This patch also changes the log format to use structured logs.

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

A terminated connection is not an error on the daemon-side, and expected
if the client disconnects. This patch detects if the error is because of
a broken pipe, and skips the warning in that case.

Before this patch:

    WARN[2025-01-18T12:38:04.115298341Z] could not write error response: write unix /var/run/docker.sock->@: write: broken pipe

After this patch, no warning is logged. This patch also changes the log
format to use structured logs.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added this to the 28.0.0 milestone Jan 18, 2025
@thaJeztah thaJeztah self-assigned this Jan 18, 2025
@vvoland vvoland merged commit 456c58c into moby:master Jan 20, 2025
@thaJeztah thaJeztah deleted the build_no_broken_pipe_errs branch January 20, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants