Skip to content

fix(native-sidecar): return econnrefused for closed loopback ports - #2085

Merged
eersnington merged 1 commit into
mainfrom
fix/loopback-econnrefused
Oct 28, 2026
Merged

eersnington merged 1 commit into
mainfrom
fix/loopback-econnrefused

Conversation

@eersnington

Copy link
Copy Markdown
Member
  • A guest TCP connect to a VM loopback port with no listener (and no loopbackExemptPorts entry) now fails with ECONNREFUSED, like Linux and a container with no published ports.
  • Both places that answer this change: the sidecar connect filter and the kernel loopback check. Only the errno and message change. What is reachable does not.
  • UDP sends and connects keep their current confinement error.
Guest code Before After
net.connect(4999, "127.0.0.1"), nothing listening EACCES: blocked outbound network access … not owned by this VM ECONNREFUSED: … no listener … in this VM; host loopback ports require loopbackExemptPorts
fetch retry loop waiting for a server to start throws on the first attempt retries until the server is up
host listener on a non-exempt port not reached not reached

network-deny-vm-local.test.ts now expects ECONNREFUSED for the host-loopback case. It still asserts the host server receives no request.

A guest TCP connect to a VM loopback port with no listener and no loopbackExemptPorts entry now fails with ECONNREFUSED, as on Linux and in a container with no published ports, instead of EACCES. Wait-for-server loops that retry only on ECONNREFUSED now keep retrying. Both answering paths change: the sidecar connect filter and the kernel loopback check. UDP sends and connects keep their EACCES/EPERM confinement error. The host is still never reached unless the port is exempt.
@railway-app

railway-app Bot commented Oct 28, 2026

Copy link
Copy Markdown

This PR was not deployed automatically as @eersnington does not have access to the Railway project.

In order to get automatic PR deploys, please add @eersnington to your workspace on Railway.

@github-actions

Copy link
Copy Markdown
Contributor

📟 Pip-Boy · c5345ad

📦 Packages

❌ Not run: the changes job was cancelled. See the run.

🧹 Rust dependencies

❌ Not run: the changes job was cancelled. See the run.

🦀 Binaries

❌ Not run: the changes job was cancelled. See the run.

⏱ Timing

job wall time slowest step
⊘ changes 5m02s checkout · 4m59s
zizmor 10s checkout · 3s
report 29s checkout · 10s
⏭ self-test — skipped
⏭ hygiene — skipped
⏭ footprint — skipped
⏭ native · ${{ matrix.platform }} — skipped
🔭 Full CI trace for this commit

One OpenTelemetry trace of CI and Pip-Boy for c5345ad: every job and step, with the sizes above attached. Run after CI finishes.

pnpm install --frozen-lockfile --filter 'pipboy...'
pnpm --filter pipboy pipboy trace --sha c5345ad9097f645e3212e589b10d3e62890678aa

Add --otlp <url> to send it to any OTLP/HTTP collector.

Agent instruction: From a rivet-dev/agentos checkout, run the commands above, then read the trace file the last command prints. List the slowest jobs and steps and explain where CI time went.

@eersnington
eersnington merged commit c746292 into main Oct 28, 2026
14 of 16 checks passed
@eersnington
eersnington deleted the fix/loopback-econnrefused branch October 28, 2026 18:28
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