AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Router Prefetch Exhausts HTTP/1.1 Connection Pool, Stalling Server Actions In Self-Hosted Next Start

Under plain HTTP/1.1 self-hosting, a burst of router prefetch (_rsc) requests occupies all six browser connections per origin; a Server Action submitted while prefetches are in flight is queued/aborted, leaving the UI frozen on stale props. Deterministic reproduction included.

highConfidence 85%Next.jsnext buildApp RouterTurbopackAffected V16.2.11

Origin Analysis

The App Router's prefetch logic issues concurrent _rsc requests without a concurrency cap and does not prioritize them relative to Server Action mutations. On HTTP/1.1, the browser's six-connection limit is exhausted by prefetches; the action POST cannot be sent until a socket frees, and aborted prefetches may leave sockets in a broken state, causing the action to hang or the client to miss the revalidation response.
1. Clone https://github.com/SignaHub285/next-app-router-action-abort-repro 2. Run npm i && npm run repro 3. The script builds, starts next start behind a slow RSC proxy, drives Chromium through control (no prefetch pressure) and treatment (prefetch burst); treatment shows UI updated after click ~3876ms vs control ~278ms, with multiple aborted RSC requests.

Fixing Code Block

Edge Case Audit

This is a userland monkey-patch, not an official fix. It reduces prefetch concurrency on all HTTP versions; on HTTP/2 or HTTP/3 where concurrency is not limited by connections, it may slightly throttle prefetch speed. If a Server Action itself requires multiple concurrent requests, two free sockets may still be insufficient—adjust MAX_PREFETCH_CONCURRENCY downward. Remove the component and restore original fetch to roll back. Test thoroughly with your application's prefetch patterns.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state