Skip to content

Preserve MinoWS stream shutdown errors - #42

Merged
JonKuqi merged 1 commit into
mainfrom
36-fix-minows-shutdown-errors
Aug 27, 2026
Merged

JonKuqi merged 1 commit into
mainfrom
36-fix-minows-shutdown-errors

Conversation

@JonKuqi

@JonKuqi JonKuqi commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator
  • Preserved terminal stream errors so normal shutdown can be classified correctly.
  • Stopped EOF and reset conditions from being logged as dropped packets.
  • Preserved wrapped send errors so callers can reliably use errors.Is.

closes #36

Problem

Normal stream completion produced repeated error-level messages after tests
had already passed:

image

This was not a Gob encoding bug. gob.Decoder.Decode returned a terminal I/O or libp2p error, but listen destroyed its identity by formatting it with %v:

Using %v converts the cause into formatted text instead of preserving the original error. passMessages could therefore no longer reliably recognize errors such as io.EOF or network.ErrReset, and normal stream termination was treated as a dropped packet.

Fix

Decoder errors are now returned directly, and terminal shutdown conditions are checked with errors.Is. Send errors also use %w so their original cause remains accessible.

Expected shutdowns now terminate the receive loop quietly, while genuine decoding errors are still logged.

Verification

go test ./mino/minows -count=1

The focused EOF and cancelled-session tests also pass.

@JonKuqi JonKuqi self-assigned this Aug 25, 2026
@JonKuqi
JonKuqi requested a review from PascalinDe August 25, 2026 13:48
@JonKuqi
JonKuqi marked this pull request as ready for review August 25, 2026 13:48
@JonKuqi
JonKuqi force-pushed the 36-fix-minows-shutdown-errors branch from 86218c7 to cc98bf4 Compare August 25, 2026 16:48

@PascalinDe PascalinDe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JonKuqi
JonKuqi force-pushed the 36-fix-minows-shutdown-errors branch from cc98bf4 to 7806612 Compare August 26, 2026 15:04
@JonKuqi
JonKuqi force-pushed the 36-fix-minows-shutdown-errors branch from 7806612 to af7340f Compare August 26, 2026 15:23
@JonKuqi
JonKuqi force-pushed the 36-fix-minows-shutdown-errors branch from af7340f to e7cf7ba Compare August 26, 2026 15:26
Base automatically changed from 34-35-fix-minows-rpc-lifecycle to main August 27, 2026 08:06
@JonKuqi
JonKuqi force-pushed the 36-fix-minows-shutdown-errors branch from e7cf7ba to 3280b2e Compare August 27, 2026 08:06
@JonKuqi
JonKuqi merged commit f4059ff into main Aug 27, 2026
1 of 4 checks passed
@JonKuqi
JonKuqi deleted the 36-fix-minows-shutdown-errors branch August 27, 2026 08:07
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.

MinoWS loses connection error identity and logs normal shutdown as packet decoding failures

2 participants