workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

Wrangler 4.118.0 dev server crashes intermittently under rapid sequential fetch requests (ProxyController error)

Open keenanwh opened this issue 4 months ago • 2 comments

Description

The Wrangler local dev server (wrangler dev --local) intermittently crashes when handling rapid sequential write requests during E2E tests. The crash occurs inside the ProxyController/miniflare proxy layer, not in user Worker code.

Reproduction

  • Wrangler version: 4.118.0
  • Node version: 22
  • OS: Windows 11 Pro
  • Config: wrangler dev --local --port 8787 with KV bindings

The crash triggers when an E2E test (Playwright) sends 10 rapid sequential POST requests to a Worker endpoint, then immediately polls GET for confirmation. The Worker itself handles each request successfully (first 4 of 5 tests pass), but the dev server proxy layer crashes under the accumulated load.

Crash pattern

  1. Tests 1-4: Worker responds normally (each test does 1-3 write+poll cycles)
  2. Test 5: 10 rapid sequential writes — page.waitForResponse times out at 30s waiting for the GET poll response
  3. [WebServer] X [ERROR] emitted
  4. All subsequent fetch() calls to the Worker URL fail with TypeError: fetch failed
  5. The crash is intermittent — the same suite sometimes passes without issue

Stack trace (from Wrangler log)

Error
    at castErrorCause (wrangler-dist/cli.js:178283:20)
    at ProxyController2.emitErrorEvent (wrangler-dist/cli.js:278284:20)
    at ProxyController2.onProxyWorkerMessage (wrangler-dist/cli.js:278161:18)
    at PROXY_CONTROLLER (wrangler-dist/cli.js:277890:24)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async #handleLoopbackCustomFetchService (miniflare/dist/src/index.js:113376:22)
    at async #handleLoopback (miniflare/dist/src/index.js:113604:20)

The Error object has no message — the crash cause is opaque from the user's perspective.

Impact

This blocks CI/CD deploy pipelines that gate on E2E test suites. The workaround is to retry the deploy (intermittent), but this is unreliable for automated pipelines.

Expected behavior

The dev server should remain stable under rapid sequential request load, or fail gracefully with a clear error rather than crashing the entire server process.

keenanwh avatar Aug 01 '26 09:08 keenanwh

[!NOTE] This is an automated, advisory triage report generated by workers-devprod. It is not an official maintainer response — a maintainer will follow up.

🤖 Automated triage report

Issue Triage: cloudflare/workers-sdk#14960

Summary

wrangler dev --local intermittently crashes inside the ProxyController/miniflare proxy layer under rapid sequential fetch requests — a maintainer has already identified it as a duplicate of #14926.

Classification

  • Type: Bug
  • Component: packages/wrangler (ProxyController) + packages/miniflare (loopback handler)
  • Severity: Medium
  • Has Reproduction: No (scenario described, but no clonable repo/link)
  • Quality: Partial

Findings

  • Created: 2026-08-01
  • Author: keenanwh
  • Version: wrangler 4.118.0, Node 22, Windows 11 Pro
  • Labels: needs-reproduction, package:miniflare, package:wrangler
  • Comments: 2

Analysis

  • Maintainer confirmed duplicate. On 2026-08-11, petebacondarwin (CONTRIBUTOR) commented "Duplicate of #14926". Per the triage process (Step 2d), this is a clear-cut CLOSE-as-duplicate — the canonical issue is #14926.
  • The issue is already CLOSED (state: CLOSED), consistent with the maintainer's duplicate determination. This report documents/confirms the closure rationale.
  • The stack trace points squarely at workers-sdk internals (castErrorCause / ProxyController2.emitErrorEvent / onProxyWorkerMessage in wrangler-dist/cli.js, and #handleLoopbackCustomFetchService / #handleLoopback in miniflare/dist/src/index.js), so it is legitimately a local dev tooling bug and the repo/labels (package:wrangler, package:miniflare) are correct.
  • The report lacks a minimal reproduction (hence the pre-existing needs-reproduction label). The underlying investigation should continue on the canonical issue #14926.

Recommendation

Status: CLOSE

Reasoning: A maintainer (petebacondarwin) has explicitly identified this as a duplicate of #14926, and the issue is already closed. Tracking and any fix work should consolidate on the canonical issue.

Action: Confirm the issue remains closed as a duplicate of #14926 (state_reason: not_planned). Any further diagnostics from the reporter should be added to #14926.

Suggested Labels: none (existing needs-reproduction, package:miniflare, package:wrangler labels are already applied and appropriate)

Suggested Comment

Closing as a duplicate of #14926. Please follow that issue for updates.

Structured summary (JSON)
{
  "issueNumber": 14960,
  "title": "Wrangler 4.118.0 dev server crashes intermittently under rapid sequential fetch requests (ProxyController error)",
  "githubUrl": "https://github.com/cloudflare/workers-sdk/issues/14960",
  "recommendation": "CLOSE",
  "difficulty": "n/a",
  "reasoning": "A maintainer (petebacondarwin) explicitly marked this as a duplicate of #14926, and the issue is already closed. Investigation should consolidate on the canonical issue.",
  "suggestedAction": "Confirm closure as a duplicate of #14926 and direct any further diagnostics to that canonical issue.",
  "hasSuggestedComment": true,
  "suggestedLabels": []
}

workers-devprod avatar Aug 01 '26 09:08 workers-devprod

Duplicate of #14926

petebacondarwin avatar Aug 11 '26 12:08 petebacondarwin