[Queue] Posting many messages to a queue locally causes an exception
What versions & operating system are you using?
- Macos 27
- Tested on both
[email protected]and[email protected]
Please provide a link to a minimal reproduction
https://github.com/halfstack-dev/cloudflare-queue-error-example
Describe the Bug
When adding many messages to a cloudflare queue locally running wrangler dev the following stacktrace appears:
QuotaExceededError: You have exceeded the number of active timeouts you may set. max active timeouts: 10000, current active timeouts: 10000, finished timeouts: 0
I've tested it with around 20_000 messages in batches of 100 one-by-one (no Promise.all)
Please provide any relevant error logs
[wrangler:error] QuotaExceededError: You have exceeded the number of active timeouts you may set. max active timeouts: 10000, current active timeouts: 10000, finished timeouts: 0
at Timers.setTimeout (file:///Users/jonathan/Projects/cloudflare-queue-error-example/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/miniflare/src/workers/shared/timers.worker.ts:30:11)
at #enqueue (file:///Users/jonathan/Projects/cloudflare-queue-error-example/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/miniflare/src/workers/queues/broker.worker.ts:444:16)
at QueueBrokerObject.batch (file:///Users/jonathan/Projects/cloudflare-queue-error-example/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/miniflare/src/workers/queues/broker.worker.ts:562:8)
at async QueueBrokerObject.fetch (file:///Users/jonathan/Projects/cloudflare-queue-error-example/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/miniflare/src/workers/shared/router.worker.ts:48:13)
at async QueueBrokerObject.fetch (file:///Users/jonathan/Projects/cloudflare-queue-error-example/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/miniflare/src/workers/shared/object.worker.ts:147:11)
[wrangler:error] Error: Unknown Internal Error (15000)
at async Object.fetch (file:///Users/jonathan/Projects/cloudflare-queue-error-example/src/index.ts:10:4)
at async jsonError (file:///Users/jonathan/Projects/cloudflare-queue-error-example/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
at async drainBody (file:///Users/jonathan/Projects/cloudflare-queue-error-example/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/wrangler/templates/middleware/middleware-ensure-req-body-drained.ts:5:10)
Automated triage
Issue assessment
- Actionability: ✅ Actionable.
- Type: Bug.
- Reproduction: Automatic attempt requested.
- Labels:
product:queues(high)package:miniflare(high)
Actionability and missing information
Posting about 20000 messages in batches of 100 to a queue under wrangler dev raises QuotaExceededError from miniflare's queue broker, which caps active timeouts at 10000; seen on wrangler 4.107.1 and 4.131.2 on macOS, with a minimal reproduction repository provided.
Reproduction reason: Report describes a current local-dev defect with affected versions, full stack traces, and a minimal reproduction repository; nothing suspicious in the report.
Reproduction
- Result: ✅ Reproduced.
- Summary: Reproduced: with wrangler dev (wrangler 4.131.2, miniflare 5.20260911.1-alpha), one fetch enqueuing 20,000 messages via 200 sequential sendBatch() calls of 100 failed with HTTP 500 and the exact reported QuotaExceededError (max active timeouts: 10000, finished timeouts: 0).
Evidence and attempted steps
Steps attempted:
- Verified sandbox tooling and that wrangler 4.131.2 (with miniflare 5.20260911.1-alpha and workerd 1.20260911.1 — versions from the issue's stack trace) is available on the npm registry
- Command:
node --version && pnpm --version && npm view [email protected] version
- Command:
- Created minimal worker fixture (queue producer plus consumer, GET / enqueues 20,000 messages via sequential sendBatch() of 100) and installed pinned wrangler 4.131.2; verified wrangler 4.131.2 and workerd 2026-09-11 binaries run
- Command:
pnpm install && ./node_modules/.bin/wrangler --version
- Command:
- Ran the reproduction driver: started
wrangler devlocally on port 8787, waited for GET /health to return 200, issued one GET / whose handler does 200 sequential sendBatch() calls of 100 messages, then scanned response and wrangler logs; exit 0 = reported behavior observed- Command:
pnpm run reproduce
- Command:
Expected behavior: Enqueueing ~20,000 messages into a queue via sequential sendBatch() calls of 100 messages (no Promise.all) while running wrangler dev locally should succeed without exceptions.
Observed behavior: The fetch that enqueued 20,000 messages via sequential sendBatch() batches of 100 failed after ~495 ms (the local consumer had processed only ~4,800 messages) with HTTP 500. The wrangler dev log contained the exact reported errors: "QuotaExceededError: You have exceeded the number of active timeouts you may set. max active timeouts: 10000, current active timeouts: 10000, finished timeouts: 0" raised at Timers.setTimeout (miniflare timers.worker.ts:30:11), called from #enqueue (broker.worker.ts:444:16) within QueueBrokerObject.batch (broker.worker.ts:562:8), and "Error: Unknown Internal Error (15000)" at the Worker's fetch call site, matching the issue's stack trace verbatim with wrangler 4.131.2, miniflare 5.20260911.1-alpha, workerd 1.20260911.1.
Artifact: Download reproduction archive (Cloudflare Access required).
Treat archive contents as untrusted. Inspect them before running anything.
This summary was generated by an LLM and may contain errors. Please verify its findings.
Triage bot commands and options
Repository collaborators with write or admin access can trigger actions by commenting on this issue:
@workers-devprod reproduce: Attempt to reproduce the issue using its description and recent comments.