Fix accept loop exits that permanently kill stream/connection acceptance#345
Merged
0pcom merged 6 commits intoskycoin:developfrom Mar 16, 2026
Merged
Fix accept loop exits that permanently kill stream/connection acceptance#3450pcom merged 6 commits intoskycoin:developfrom
0pcom merged 6 commits intoskycoin:developfrom
Conversation
Non-fatal errors in accept loops were causing permanent exit of the goroutine. The listener/session remains open but never accepts again, silently stopping all new connections until process restart. Fixed in: dmsgctrl ServeListener, server session smux and yamux stream accept loops.
- client.go: Fix send-on-closed-channel race in session serve goroutine
by adding mutex protection and select with default case
- client.go: Fix unsafe type assertion on ctx.Value("dmsgServer") that
panics if value is not a string
- stream.go: Convert prepareFields from panic to error return so callers
can handle noise initialization failure gracefully
- host.go: Change whitelist error from Panic to Error log level so
transient whitelist errors don't crash the pty host
- noise.go: Replace panic in RemoteStatic with error log and empty key
return so corrupted handshake data doesn't crash the process
- read_writer.go: Replace panic in ReadRawFrame Discard with error
return so reader errors propagate instead of crashing
…am.go - Add error check for prepareFields in writeIPRequest (errcheck) - Replace all naked returns with explicit returns in writeRequest, writeIPRequest, and readRequest to satisfy nakedret linter
- ui.go: Check bw.Close() return value (errcheck) - ui_html.go: Remove blank lines after opening brace (gofmt) - ui_html.go: Cap gzip decompression with LimitReader (gosec G110)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non-fatal errors in accept loops were causing permanent exit of the goroutine. The listener/session remains open but never accepts again, silently stopping all new connections until process restart.
Fixed in: dmsgctrl ServeListener, server session smux and yamux stream accept loops.