Skip to content

[v3/dev] Asset proxy exhausts host ephemeral ports on large frontends #5947

Description

@taliesin-ai

Reproduction evidence

PR #5933 reports and measures the v3 development asset proxy exhausting the host ephemeral-port range when a large frontend serves many unbundled modules. The proxy transport retains only the Go default of two idle connections per host.

On macOS 26.2 with a large Vue frontend, the reporter measured:

  • 13,511 TIME_WAIT sockets to the Vite port
  • 16,299 / 16,384 ephemeral ports consumed (99.5%)
  • 2,169 LAST_ACK and 1,650 FIN_WAIT_1 sockets
  • zero established connections to the Vite port before the fix

After the focused pooling change, the same load produced zero TIME_WAIT sockets and about 52 retained connections. The synthetic regression test reports 597 upstream connections before the fix and 46–70 after it for 1,000 requests. Once exhausted, Wails, browsers, and unrelated CLI tools fail outbound connections with EADDRNOTAVAIL; the reporter required a reboot to clear the backlog.

Scope and impact

This is development-only (build_dev.go is excluded by the production build tag), but it can disrupt every process on the host and makes large Wails projects effectively unusable in wails3 dev. The release work is limited to reviewing and validating the existing focused fix in #5933; do not broaden it into retry-policy changes.

Acceptance criteria

  • The dev proxy reuses upstream connections under concurrent module loads.
  • Idle connection retention is explicitly bounded and timed out.
  • Address-exhaustion failures are not amplified by the retry classifier.
  • Focused tests prove connection reuse and production-tag builds remain unaffected.
  • Current-master integration and relevant hosted checks pass.
  • Existing PR fix(v3): stop the dev asset proxy exhausting the host's ephemeral ports #5933 is used; no duplicate implementation PR is created.

Related implementation: #5933.

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingMacOSP1High priorityv3

Type

No type

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions