Skip to content

fix(build-tools): make http.Server unref() release the event loop - #2068

Merged
eersnington merged 1 commit into
mainfrom
fix/http-server-unref
Oct 21, 2026
Merged

eersnington merged 1 commit into
mainfrom
fix/http-server-unref

Conversation

@eersnington

Copy link
Copy Markdown
Member
  • http.Server.ref() and unref() returned this without doing anything, so an unref()'d HTTP server kept the guest process alive until the call timed out. Node lets the process exit.
  • Both calls now forward to the inner net server, and an unref() before listen() is applied when the server starts, as in Node. https.Server inherits the fix.

Found while investigating #1991.

http.Server ref() and unref() were no-ops, so the inner net.Server kept its active handle and an unref'd HTTP server held the guest process open. Forward both calls to the inner net server, and apply an early unref() when listen() creates it.
@railway-app

railway-app Bot commented Oct 21, 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 · 6696bb0

📦 Packages · fresh npm install resolve, no lockfile · this PR vs base

No notable install size, dependency, or entrypoint changes across 6 packages.

All 6 packages · linux-x64-gnu
package (linux-x64-gnu) @latest base this PR Δ vs base packages
@rivet-dev/agentos-core 458.2 MB 458.2 MB 458.2 MB 0 121 (0)
@rivet-dev/agentos-node-pty 7.6 KB 18.0 KB 18.0 KB 0 1 (0)
@rivet-dev/agentos-posix 253.6 MB 253.6 MB 253.6 MB 0 7 (0)
@rivet-dev/agentos-runtime-core 253.6 MB 253.6 MB 253.6 MB 0 6 (0)
@rivet-dev/agentos-sandbox 495.5 MB 495.5 MB 495.5 MB 0 177 (0)
@rivet-dev/agentos-toolchain 130.8 KB 141.2 KB 141.2 KB 0 2 (0)

🧹 Rust dependencies · cargo deny + cargo shear

check new in this PR fixed existing on base
advisories ✅ 0 0 25
licenses ✅ 0 0 0
sources ✅ 0 0 0
bans ✅ 0 0 0
unused ✅ 0 0 16

🦀 Binaries · publish Dockerfiles, --release

Base: main@8cc8f8b, the merge base.

artifact npm @latest base this PR Δ vs base
agentos-native-sidecar linux-x64-gnu 143.6 MB 143.6 MB 143.6 MB −16 B (−0.0%)

⏱ Timing

job wall time slowest step
changes 1m22s checkout · 46s
zizmor 9s checkout · 2s
footprint 1m56s Pack this commit · 34s
hygiene 56s checkout · 23s
native · linux-x64-gnu 12m37s Build with the publish Dockerfile · 12m14s
⏭ self-test — skipped
report 20s Write the comment and run summary · 5s
🔭 Full CI trace for this commit

One OpenTelemetry trace of CI and Pip-Boy for 6696bb0: 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 6696bb0c6dbe9e53a04f370cd03553748725fefc

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 e2f2e94 into main Oct 21, 2026
14 of 15 checks passed
@eersnington
eersnington deleted the fix/http-server-unref branch October 21, 2026 15:04
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