Skip to content

Vendor dmsg e26b2982: fix ephemeral port leak + picomatch bump#2284

Merged
0pcom merged 1 commit intoskycoin:developfrom
0pcom:fix/vendor-dmsg-port-leak
Apr 7, 2026
Merged

Vendor dmsg e26b2982: fix ephemeral port leak + picomatch bump#2284
0pcom merged 1 commit intoskycoin:developfrom
0pcom:fix/vendor-dmsg-port-leak

Conversation

@0pcom
Copy link
Copy Markdown
Collaborator

@0pcom 0pcom commented Apr 7, 2026

Summary

dmsg changes vendored

  • ClientSession.DialStream now accepts context.Context — when canceled, the stream is closed immediately, freeing the reserved ephemeral port
  • Server idle timeout on bridged streams (5-minute timeout prevents 55K+ goroutine accumulation)
  • Fix flaky TestHTTPTransport_RoundTrip test

Root cause of ephemeral port exhaustion

The setup-node's NewClient had a 30s dial timeout, but ClientSession.DialStream didn't accept a context. When the timeout fired, readResponse kept blocking until HandshakeTimeout, holding the ephemeral port. With 6 servers tried sequentially per dial, ports accumulated faster than they were freed.

Test plan

  • CI passes
  • Setup-node no longer exhausts ephemeral ports under load

dmsg changes:
- ClientSession.DialStream now accepts context.Context
- When context is canceled, stream is closed immediately, freeing
  the reserved ephemeral port
- Fix flaky TestHTTPTransport_RoundTrip (timeout + stabilization)
- Server idle timeout on bridged streams (from previous vendor)

skywire changes:
- Fix api_dmsg.go DialStream call to pass context
- Bump picomatch 2.3.1 -> 4.0.4 (dependabot security fix)
@0pcom 0pcom merged commit 5c39cc1 into skycoin:develop Apr 7, 2026
2 of 3 checks passed
@0pcom 0pcom deleted the fix/vendor-dmsg-port-leak branch April 7, 2026 22:53
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