Skip to content

Fix accept loop exits that permanently kill stream/connection acceptance#345

Merged
0pcom merged 6 commits intoskycoin:developfrom
0pcom:fix-accept-loop-exits
Mar 16, 2026
Merged

Fix accept loop exits that permanently kill stream/connection acceptance#345
0pcom merged 6 commits intoskycoin:developfrom
0pcom:fix-accept-loop-exits

Conversation

@0pcom
Copy link
Collaborator

@0pcom 0pcom commented Mar 16, 2026

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.

0pcom added 6 commits March 16, 2026 08:22
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)
@0pcom 0pcom merged commit 4ed20dc into skycoin:develop Mar 16, 2026
3 checks passed
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