Skip to content

feat(dev): isolate requests in parent-owned workers#760

Open
ctgowrie wants to merge 1 commit into
feat/dev-generation-artifactsfrom
feat/dev-parent-worker-transport
Open

feat(dev): isolate requests in parent-owned workers#760
ctgowrie wants to merge 1 commit into
feat/dev-generation-artifactsfrom
feat/dev-parent-worker-transport

Conversation

@ctgowrie

Copy link
Copy Markdown
Collaborator

Why

Nitro currently owns both the public dev listener and its reloadable runtime. Replacing that runtime can reset admitted HTTP or WebSocket traffic, lose the original client address, and make shutdown wait on streams whose producer has not stopped.

What changed

  • Keep one parent-owned listener while ready-gated worker candidates move through candidate, active, retired, and closed states.
  • Bind each admission to one worker and the latest published artifact generation; release leases idempotently on finish, error, disconnect, cancellation, and shutdown.
  • Propagate cancellation in both directions and stop workers, active streams, and sockets before awaiting listener closure.
  • Move runtime-artifact control requests into the parent so candidate replacement cannot reset them.
  • Pass client addresses through signed parent-to-worker metadata, strip that metadata before authored HTTP and WebSocket handlers, and reject spoofed values.
  • Vendor the internal worker transport implementation so eve gains no runtime dependency.

Validation

  • Unit: 448 files; 4,689 passed, 1 skipped.
  • Integration: 62 files; 440 passed.
  • Scenario: 53 files; 311 passed, 15 skipped.
  • Focused packaged dev scenarios cover ready replacement, retained WebSockets, runtime-generation HMR, startup-generation pruning, streamed turns, and absence of ECONNRESET/socket-hang-up logs.
  • Formatting, lint, workspace typecheck, and invariant guard pass.

Stack

Depends on #759 (immutable generation artifacts). Stage 4 will make watcher, pointer, route, and worker promotion one transaction. Stage 5 will move the local Workflow World and queue ownership into the parent and add durable generation references plus pruning.

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
eve-docs Building Building Preview, Comment Jul 14, 2026 12:26pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
eve-docs-1644 Skipped Skipped Jul 14, 2026 12:26pm
eve-docs-4759 Skipped Skipped Jul 14, 2026 12:26pm

@ctgowrie ctgowrie force-pushed the feat/dev-parent-worker-transport branch from feaf376 to 135761c Compare July 14, 2026 12:26
@vercel vercel Bot temporarily deployed to Preview – eve-docs-1644 July 14, 2026 12:26 Inactive
@vercel vercel Bot temporarily deployed to Preview – eve-docs-4759 July 14, 2026 12:26 Inactive
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