Skip to content

Silence benign teardown errors from TCPConn.WriteTo (Go 1.27) - #2

Open
ljzczh wants to merge 1 commit into
hadi77ir:mainfrom
ljzczh:fix/silence-writeto-teardown-error
Open

ljzczh wants to merge 1 commit into
hadi77ir:mainfrom
ljzczh:fix/silence-writeto-teardown-error

Conversation

@ljzczh

@ljzczh ljzczh commented Sep 12, 2026

Copy link
Copy Markdown

Newer Go added io.WriterTo support to *net.TCPConn, so io.Copy now prefers WriteTo and wraps teardown errors as OpError{Op: "writeto"} instead of read. These are normal connection-close races (e.g. WebSocket client disconnects), but they fall through the existing readfrom/read filter and get logged as ERROR. This adds writeto to the ignored ops, consistent with the existing intent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant