Skip to content

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections - #2547

Merged
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak
Jun 20, 2026
Merged

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections#2547
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak

Conversation

@smaeda-ks

@smaeda-kssmaeda-ks commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

decodeFrames (the v4 event frame-stream reader) never cancelled its underlying response.body when a consumer stopped reading before EOF. With Node's fetch/undici, a response body that is neither fully drained nor cancelled keeps its socket checked out of the connection pool — so every such read leaks a connection until keepalive timeout/GC.

Two live read paths stop early by design and hit this:

CallerEarly exitFrequency
getEventV4returns after the first frame (single-frame response)per event read
consumeListFrameStream (getWorkflowRunEventsV4 / getEventsByCorrelationIdV4)breaks at the {_end:1} sentinelper event-list, i.e. ~every replay

This is the v4 wire format that events.ts uses "throughout" (it replaced the v2/v3 readers), so the leak is on the current, hot replay path — not legacy code.

Why it matters

In production every event read goes to a single origin — vercel-workflow.com (direct) or api.vercel.com (proxy) — and the dispatcher caps that origin at connections: 8 (HTTP/1.1). A leaked body holds its connection "in use," so it isn't returned to the pool. Pin ~8 of them and the pool is saturated: subsequent reads queue until a connection frees (the dropped response is GC-reclaimed, or the 60s request timeout fires). The user-visible result is intermittent stalls and timeouts on the event-read path; because each pinned connection ends up single-use instead of kept-alive, connection churn rises too.

Fix

packages/world-vercel/src/frames.ts:

  • Wrap the decodeFrames read loop in try/finally and call chunks.return?.() on exit, which cancels the source stream (releasing the socket) on early break/return, normal completion, and error paths alike. No-op once drained.
  • readerToIterator now cancels its reader in a finally (the non-async-iterable fallback branch).
  • Both share a small internal closeQuietly helper that swallows only cleanup errors, so it can't mask the original outcome.
  • Collapsed the redundant bodyLen > 0 / else branch into one path (slice(0, 0) already yields an empty body) — behavior identical.

Returned values are unaffected: frame.body is an owned slice copy, and the cancel runs after the result is assembled, so cancelling the remaining body can't corrupt what callers receive.

Test plan

  • packages/world-vercel/src/frames.test.ts: new tests asserting the underlying stream is cancelled when the consumer breaks early — for both the async-iterable branch and the getReader/readerToIterator branch — plus a guard that full consumption still decodes every frame. The spyStream helper models a kept-alive socket (highWaterMark: 0, never signals EOF); a toy stream that auto-closes would make cancel() a no-op and give a false pass.
  • packages/world-vercel/src/events-v4.test.ts: new getEventV4 HTTP round-trip via undici MockAgent (this path previously had no test). Includes a trailing frame the reader must never read, proving the early return + cancel returns correct data and doesn't hang.
  • Verified the new tests fail against pre-fix code and pass with the fix.
  • pnpm test (world-vercel): 167 passed. pnpm typecheck and biome check: clean.

Scope

Targets the decodeFrames early-exit leak only. A few lower-frequency error/edge paths (streamer.tsget()/list() throwing without draining; the content-type / missing-header throws in events-v4.ts) are the same class of issue and can be a follow-up.

🤖 Generated with Claude Code

decodeFrames never cancelled response.body when a consumer stopped reading
before EOF — getEventV4 returns after the first frame and consumeListFrameStream
breaks at the sentinel — so the undici connection stayed checked out of the pool
(8 per origin) instead of being released, causing stalls/timeouts on the
event-read path.
Cancel the source in a try/finally (and cancel the reader in readerToIterator)
via a shared closeQuietly helper. Add regression tests for both decode branches
and a getEventV4 HTTP round-trip through undici MockAgent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fc2f47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production114312241368
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7893110748968

❌ Failed Tests

▲ Vercel Production (1 failed)

nuxt (1 failed):

  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nitro125027
❌ nuxt124127
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.043s (+6.1% 🔺)1.006s (~)0.963s101.00x
💻 LocalExpress0.045s (+9.7% 🔺)1.006s (~)0.961s101.04x
💻 LocalNext.js (Turbopack)0.051s (+5.6% 🔺)1.006s (~)0.955s101.17x
🐘 PostgresNext.js (Turbopack)0.054s (-6.2% 🟢)1.011s (~)0.957s101.25x
🐘 PostgresNitro0.065s (+3.3%)1.012s (~)0.947s101.50x
🐘 PostgresExpress0.094s (+53.0% 🔺)1.033s (+2.1%)0.939s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.364s (-8.4% 🟢)2.332s (-4.3%)1.968s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.090s (-0.9%)2.007s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.093s (~)2.007s (~)0.914s101.00x
💻 LocalNitro1.096s (+0.7%)2.007s (~)0.911s101.01x
🐘 PostgresNext.js (Turbopack)1.102s (~)2.011s (~)0.909s101.01x
🐘 PostgresNitro1.112s (+0.7%)2.009s (~)0.897s101.02x
🐘 PostgresExpress1.112s (+0.8%)2.010s (~)0.898s101.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.893s (+24.5% 🔺)3.512s (-1.6%)1.619s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.505s (~)11.012s (~)0.507s31.00x
💻 LocalNitro10.519s (~)11.023s (~)0.504s31.00x
💻 LocalExpress10.523s (~)11.024s (~)0.501s31.00x
🐘 PostgresNext.js (Turbopack)10.527s (~)11.021s (~)0.494s31.00x
💻 LocalNext.js (Turbopack)10.544s (~)11.023s (~)0.479s31.00x
🐘 PostgresNitro10.548s (~)11.018s (~)0.470s31.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express13.799s (+5.4% 🔺)15.362s (+1.0%)1.564s21.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.737s (~)14.018s (~)0.281s51.00x
💻 LocalExpress13.742s (-1.8%)14.027s (-1.4%)0.284s51.00x
💻 LocalNitro13.782s (+0.7%)14.028s (~)0.246s51.00x
🐘 PostgresNitro13.805s (-0.7%)14.018s (~)0.213s51.00x
🐘 PostgresNext.js (Turbopack)13.837s (-0.6%)14.023s (~)0.186s51.01x
💻 LocalNext.js (Turbopack)13.855s (+1.1%)14.028s (~)0.174s51.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express22.314s (+10.7% 🔺)23.407s (+4.4%)1.092s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)12.376s (-1.2%)13.016s (~)0.639s71.00x
💻 LocalExpress12.387s (-1.6%)13.025s (~)0.638s71.00x
🐘 PostgresNitro12.475s (+0.6%)13.022s (~)0.547s71.01x
💻 LocalNext.js (Turbopack)12.485s (~)13.025s (~)0.541s71.01x
💻 LocalNitro12.649s (+2.9%)13.027s (~)0.378s71.02x
🐘 PostgresExpress13.722s (+10.2% 🔺)14.042s (+7.9% 🔺)0.320s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.031s (+34.8% 🔺)33.465s (+33.0% 🔺)2.434s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (~)2.008s (~)0.854s151.00x
🐘 PostgresNitro1.193s (~)2.009s (~)0.816s151.03x
💻 LocalExpress1.223s (-0.6%)2.006s (~)0.783s151.06x
🐘 PostgresExpress1.236s (+3.4%)2.012s (~)0.776s151.07x
💻 LocalNitro1.238s (+2.9%)2.007s (~)0.769s151.07x
💻 LocalNext.js (Turbopack)1.294s (-5.9% 🟢)2.006s (~)0.712s151.12x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.811s (+4.4%)4.319s (-3.1%)1.508s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.264s (+1.0%)2.009s (~)0.744s151.00x
🐘 PostgresExpress1.271s (-2.8%)2.012s (-3.0%)0.741s151.01x
🐘 PostgresNitro1.276s (+0.5%)2.008s (~)0.732s151.01x
💻 LocalNitro2.000s (-0.8%)2.316s (-7.6% 🟢)0.316s131.58x
💻 LocalExpress2.152s (+5.7% 🔺)2.392s (-4.6%)0.241s131.70x
💻 LocalNext.js (Turbopack)2.297s (-2.0%)2.735s (-6.3% 🟢)0.438s111.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.236s (+14.1% 🔺)4.742s (+3.3%)1.506s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.486s (+2.5%)3.762s (+2.2%)2.276s81.00x
🐘 PostgresNext.js (Turbopack)1.516s (+2.3%)3.885s (~)2.369s81.02x
🐘 PostgresExpress1.617s (-2.4%)3.570s (-5.1% 🟢)1.953s91.09x
💻 LocalNitro5.496s (+22.6% 🔺)6.015s (+20.0% 🔺)0.519s53.70x
💻 LocalExpress5.652s (-2.1%)6.016s (-6.2% 🟢)0.364s53.80x
💻 LocalNext.js (Turbopack)6.781s (+1.4%)7.416s (~)0.635s54.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.669s (+117.1% 🔺)8.889s (+80.3% 🔺)2.220s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.144s (-2.5%)2.007s (~)0.864s151.00x
🐘 PostgresExpress1.188s (-0.6%)2.014s (~)0.826s151.04x
🐘 PostgresNitro1.203s (~)2.007s (~)0.804s151.05x
💻 LocalExpress1.204s (-2.1%)2.006s (~)0.802s151.05x
💻 LocalNitro1.231s (~)2.007s (~)0.776s151.08x
💻 LocalNext.js (Turbopack)1.393s (+3.1%)2.006s (~)0.614s151.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.013s (+48.9% 🔺)4.449s (+13.9% 🔺)1.436s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.257s (-0.5%)2.150s (+3.6%)0.893s141.00x
🐘 PostgresExpress1.263s (-2.5%)2.006s (~)0.744s151.00x
🐘 PostgresNitro1.292s (+1.3%)2.008s (~)0.716s151.03x
💻 LocalExpress1.988s (-2.4%)2.470s (-9.8% 🟢)0.482s131.58x
💻 LocalNitro1.997s (-0.6%)2.508s (+8.4% 🔺)0.511s121.59x
💻 LocalNext.js (Turbopack)2.250s (-7.0% 🟢)2.734s (-6.3% 🟢)0.485s111.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.587s (+39.0% 🔺)5.426s (+24.8% 🔺)1.839s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.446s (-0.7%)3.760s (~)2.314s81.00x
🐘 PostgresExpress1.451s (+1.4%)3.677s (-2.2%)2.226s91.00x
🐘 PostgresNext.js (Turbopack)1.477s (+0.5%)4.009s (+3.2%)2.532s81.02x
💻 LocalExpress5.477s (-8.2% 🟢)6.017s (-11.7% 🟢)0.540s53.79x
💻 LocalNitro5.878s (+18.9% 🔺)6.417s (+16.4% 🔺)0.539s54.07x
💻 LocalNext.js (Turbopack)6.700s (-1.3%)7.219s (-3.9%)0.519s54.63x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.783s (+35.9% 🔺)7.504s (+23.1% 🔺)1.721s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.518s (-8.3% 🟢)1.006s (-1.7%)0.488s601.00x
🐘 PostgresExpress0.525s (-8.8% 🟢)1.025s (~)0.500s591.01x
🐘 PostgresNitro0.551s (-2.0%)1.006s (-1.6%)0.456s601.06x
💻 LocalExpress0.572s (-6.3% 🟢)1.005s (~)0.433s601.10x
💻 LocalNext.js (Turbopack)0.585s (-4.4%)1.005s (-1.7%)0.420s601.13x
💻 LocalNitro0.604s (+5.9% 🔺)1.005s (-1.6%)0.401s601.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.117s (+20.0% 🔺)5.558s (+2.4%)1.441s111.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.258s (-1.4%)2.007s (~)0.749s451.00x
🐘 PostgresExpress1.304s (-1.6%)1.946s (-3.1%)0.641s471.04x
🐘 PostgresNitro1.310s (+2.8%)2.008s (~)0.698s451.04x
💻 LocalExpress1.493s (-4.2%)2.028s (~)0.535s451.19x
💻 LocalNext.js (Turbopack)1.506s (+2.1%)2.006s (~)0.500s451.20x
💻 LocalNitro1.506s (+8.9% 🔺)2.007s (~)0.500s451.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express10.059s (+17.3% 🔺)12.286s (+17.8% 🔺)2.227s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.356s (-10.6% 🟢)2.984s (-2.4%)0.628s411.00x
🐘 PostgresNext.js (Turbopack)2.527s (-0.9%)3.009s (~)0.482s401.07x
🐘 PostgresNitro2.608s (-1.7%)3.059s (-2.5%)0.451s401.11x
💻 LocalExpress3.231s (-0.6%)3.977s (-0.8%)0.746s311.37x
💻 LocalNext.js (Turbopack)3.258s (+1.7%)4.010s (+0.8%)0.751s301.38x
💻 LocalNitro3.296s (+10.0% 🔺)4.010s (+16.7% 🔺)0.714s301.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.195s (+27.6% 🔺)21.256s (+23.4% 🔺)2.061s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.167s (-6.5% 🟢)1.007s (~)0.840s601.00x
🐘 PostgresExpress0.200s (-8.5% 🟢)1.012s (+0.6%)0.812s601.20x
🐘 PostgresNitro0.229s (+8.3% 🔺)1.006s (~)0.777s601.37x
💻 LocalExpress0.345s (+1.0%)1.005s (~)0.660s602.06x
💻 LocalNitro0.358s (+6.0% 🔺)1.005s (~)0.647s602.14x
💻 LocalNext.js (Turbopack)0.633s (+4.6%)1.039s (+3.4%)0.406s583.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.608s (+27.1% 🔺)3.173s (+7.4% 🔺)1.565s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.271s (+1.1%)1.029s (+2.3%)0.758s881.00x
🐘 PostgresNitro0.345s (+6.7% 🔺)1.007s (~)0.662s901.27x
🐘 PostgresExpress0.514s (+60.2% 🔺)1.043s (+3.7%)0.529s871.90x
💻 LocalNitro2.066s (+2.0%)2.537s (+2.8%)0.471s367.62x
💻 LocalExpress2.070s (+5.8% 🔺)2.470s (~)0.400s377.64x
💻 LocalNext.js (Turbopack)2.643s (-0.9%)3.296s (+7.2% 🔺)0.652s289.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.327s (+37.2% 🔺)4.125s (+16.7% 🔺)1.798s231.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s (+0.8%)2.936s (-3.2%)2.451s411.00x
🐘 PostgresNitro0.516s (-1.7%)1.068s (+1.8%)0.553s1131.06x
🐘 PostgresExpress0.579s (+17.4% 🔺)1.120s (+10.4% 🔺)0.541s1081.19x
💻 LocalNitro9.822s (+5.0%)10.445s (+3.3%)0.622s1220.23x
💻 LocalExpress9.969s (+1.9%)10.695s (+0.8%)0.726s1220.53x
💻 LocalNext.js (Turbopack)11.201s (+11.3% 🔺)12.131s (+9.1% 🔺)0.929s1023.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.258s (+75.6% 🔺)6.218s (+42.1% 🔺)1.959s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (-1.3%)2.001s (~)0.001s (~)2.011s (~)0.856s101.00x
💻 LocalNext.js (Turbopack)1.157s (~)2.003s (~)0.012s (-3.2%)2.019s (~)0.862s101.00x
💻 LocalExpress1.169s (~)2.005s (~)0.012s (-4.1%)2.020s (~)0.851s101.01x
💻 LocalNitro1.171s (+1.8%)2.005s (~)0.013s (+37.0% 🔺)2.020s (~)0.850s101.01x
🐘 PostgresNitro1.176s (+0.6%)1.995s (~)0.001s (-31.6% 🟢)2.011s (~)0.835s101.02x
🐘 PostgresExpress1.269s (+7.7% 🔺)1.971s (-1.2%)0.001s (-42.9% 🟢)2.029s (+0.9%)0.760s101.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.523s (+11.7% 🔺)3.515s (+3.1%)2.599s (-4.0%)6.612s (-3.0%)4.090s101.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.576s (-0.5%)2.010s (~)0.012s (~)2.025s (~)0.449s301.00x
🐘 PostgresNext.js (Turbopack)1.595s (~)2.010s (~)0.005s (+10.1% 🔺)2.026s (~)0.430s301.01x
🐘 PostgresNitro1.599s (-2.6%)2.005s (-1.6%)0.005s (+1.3%)2.027s (-1.5%)0.428s301.01x
💻 LocalNitro1.611s (+2.0%)2.010s (~)0.012s (~)2.025s (~)0.415s301.02x
💻 LocalNext.js (Turbopack)1.645s (+1.7%)2.008s (~)0.013s (-1.6%)2.025s (~)0.380s301.04x
🐘 PostgresExpress1.722s (+8.6% 🔺)2.144s (+7.0% 🔺)0.004s (-15.1% 🟢)2.169s (+7.0% 🔺)0.447s281.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.853s (+11.7% 🔺)8.340s (+6.3% 🔺)0.224s (-21.0% 🟢)9.063s (+4.5%)2.210s71.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.793s (+3.1%)1.070s (-3.1%)0.000s (-1.8%)1.097s (-1.9%)0.304s551.00x
🐘 PostgresNext.js (Turbopack)0.810s (+6.4% 🔺)1.111s (+2.1%)0.000s (+111.1% 🔺)1.119s (+2.1%)0.309s541.02x
🐘 PostgresExpress1.124s (+47.2% 🔺)1.532s (+44.0% 🔺)0.000s (+Infinity% 🔺)1.560s (+44.6% 🔺)0.436s391.42x
💻 LocalExpress1.361s (+2.9%)2.013s (~)0.001s (+54.5% 🔺)2.016s (~)0.655s301.72x
💻 LocalNitro1.377s (+0.9%)2.014s (~)0.001s (+50.0% 🔺)2.017s (~)0.640s301.74x
💻 LocalNext.js (Turbopack)1.496s (+3.3%)2.013s (~)0.001s (+77.8% 🔺)2.017s (~)0.521s301.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.729s (+10.4% 🔺)4.651s (-7.8% 🟢)0.000s (-54.2% 🟢)5.149s (-7.5% 🟢)1.419s121.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.578s (-4.7%)2.257s (+1.9%)0.000s (-100.0% 🟢)2.289s (+2.6%)0.711s271.00x
🐘 PostgresNext.js (Turbopack)1.935s (+1.4%)2.544s (~)0.000s (+Infinity% 🔺)2.552s (~)0.617s241.23x
🐘 PostgresExpress2.497s (+63.3% 🔺)3.006s (+43.1% 🔺)0.000s (+33.3% 🔺)3.068s (+42.6% 🔺)0.571s211.58x
💻 LocalExpress3.453s (-5.2% 🟢)3.965s (-6.2% 🟢)0.000s (-43.7% 🟢)3.969s (-6.2% 🟢)0.517s162.19x
💻 LocalNitro3.647s (+4.2%)4.092s (+3.3%)0.000s (-64.4% 🟢)4.099s (+3.2%)0.452s152.31x
💻 LocalNext.js (Turbopack)3.962s (-3.8%)4.529s (-1.5%)0.000s (-72.2% 🟢)4.534s (-1.6%)0.572s142.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.001s (-27.3% 🟢)7.053s (-28.6% 🟢)0.000s (-100.0% 🟢)7.582s (-27.4% 🟢)1.581s81.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress14/21
🐘 PostgresNext.js (Turbopack)14/21
▲ VercelExpress21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres15/21
Next.js (Turbopack)🐘 Postgres19/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@vercel
vercelBot requested a deployment to Preview – workbench-express-workflow June 20, 2026 19:05 Abandoned
@smaeda-ks
smaeda-ks marked this pull request as ready for review June 20, 2026 19:12
@smaeda-ks
smaeda-ks requested a review from a team as a code ownerJune 20, 2026 19:12
@VaguelySerious
VaguelySerious merged commit e3672e8 into mainJun 20, 2026
113 of 119 checks passed
@VaguelySerious
VaguelySerious deleted the shohei/conn-leak branch June 20, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for e3672e8 (AI decision).

This fix targets the decodeFrames/readerToIterator machinery in packages/world-vercel/src/frames.ts (and tests in frames.test.ts / events-v4.test.ts), none of which exist on stable — verified that stable has no frames.ts, no events-v4.*, and an events.ts with no streaming/frame-decoding logic at all. The v4 frame-stream wire format is main-only, so the bug being fixed does not exist on stable and the change cannot apply there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

e3672e84f4996fbd35fc2542d11d401979d76924

pranaygp added a commit that referenced this pull request Jun 22, 2026
…testing
* origin/main:
Version Packages (beta) (#2540)
perf(core): memoize step return value hydration across inline replays (#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (#2412)
Amend lazy discovery removal changeset (#2560)
[docs] Document minimum SDK version for using hook.getConflict (#2423)
Update default CODEOWNERS (#2556)
Optimize and fix the default eager build mode (#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (#2547)" (#2554)
[core] Turbo mode: fast-path the first invocation (#2526)
Remove lazy discovery from workflow/next (#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (#2547)
feat(docs): add eve and AI SDK to product switcher (#2543)
[vitest] Fix local imports failing to load in test step bundles (#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (#2324)
Version Packages (beta) (#2495)
otel(world-vercel): inject trace context on v4 event requests (#2533)
Bump undici to 7.28.0 (#2534)
Default source maps to dev-on / prod-off (#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (#2527)
perf(core): parallel inline steps + optimistic lazy step start (#2516)
pranaygp added a commit to marcopiraccini/workflow that referenced this pull request Jun 22, 2026
* origin/main: (120 commits)
Version Packages (beta) (vercel#2540)
perf(core): memoize step return value hydration across inline replays (vercel#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (vercel#2412)
Amend lazy discovery removal changeset (vercel#2560)
[docs] Document minimum SDK version for using hook.getConflict (vercel#2423)
Update default CODEOWNERS (vercel#2556)
Optimize and fix the default eager build mode (vercel#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)" (vercel#2554)
[core] Turbo mode: fast-path the first invocation (vercel#2526)
Remove lazy discovery from workflow/next (vercel#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)
feat(docs): add eve and AI SDK to product switcher (vercel#2543)
[vitest] Fix local imports failing to load in test step bundles (vercel#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (vercel#2324)
Version Packages (beta) (vercel#2495)
otel(world-vercel): inject trace context on v4 event requests (vercel#2533)
Bump undici to 7.28.0 (vercel#2534)
Default source maps to dev-on / prod-off (vercel#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (vercel#2527)
perf(core): parallel inline steps + optimistic lazy step start (vercel#2516)
...
VaguelySerious added a commit that referenced this pull request Jul 10, 2026
The straight reapply of #2547 awaited chunks.return?.()/reader.cancel()
in decodeFrames' finally block, blocking every early-exit caller
(getEventV4, every replay's list read) on the cancel's completion. On
Vercel's Next.js (turbopack + webpack) Function lanes this hung
indefinitely — confirmed via CI: every single E2E Vercel Prod run got
stuck in "running" after its step completed, for the full 30-minute
window, while all other frameworks passed cleanly in ~15 minutes.
Same failure signature and same two CI lanes as #2807's awaited
reader.cancel() bug in the core abort-stream reader — very likely the
actual (undocumented) reason #2547 was reverted. Fix: fire-and-forget
the cancel, matching #2807's pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@smaeda-ks@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections by smaeda-ks · Pull Request #2547 · vercel/workflow · GitHub
Skip to content

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections - #2547

Merged
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak
Jun 20, 2026
Merged

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections#2547
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak

Conversation

@smaeda-ks

@smaeda-kssmaeda-ks commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

decodeFrames (the v4 event frame-stream reader) never cancelled its underlying response.body when a consumer stopped reading before EOF. With Node's fetch/undici, a response body that is neither fully drained nor cancelled keeps its socket checked out of the connection pool — so every such read leaks a connection until keepalive timeout/GC.

Two live read paths stop early by design and hit this:

CallerEarly exitFrequency
getEventV4returns after the first frame (single-frame response)per event read
consumeListFrameStream (getWorkflowRunEventsV4 / getEventsByCorrelationIdV4)breaks at the {_end:1} sentinelper event-list, i.e. ~every replay

This is the v4 wire format that events.ts uses "throughout" (it replaced the v2/v3 readers), so the leak is on the current, hot replay path — not legacy code.

Why it matters

In production every event read goes to a single origin — vercel-workflow.com (direct) or api.vercel.com (proxy) — and the dispatcher caps that origin at connections: 8 (HTTP/1.1). A leaked body holds its connection "in use," so it isn't returned to the pool. Pin ~8 of them and the pool is saturated: subsequent reads queue until a connection frees (the dropped response is GC-reclaimed, or the 60s request timeout fires). The user-visible result is intermittent stalls and timeouts on the event-read path; because each pinned connection ends up single-use instead of kept-alive, connection churn rises too.

Fix

packages/world-vercel/src/frames.ts:

  • Wrap the decodeFrames read loop in try/finally and call chunks.return?.() on exit, which cancels the source stream (releasing the socket) on early break/return, normal completion, and error paths alike. No-op once drained.
  • readerToIterator now cancels its reader in a finally (the non-async-iterable fallback branch).
  • Both share a small internal closeQuietly helper that swallows only cleanup errors, so it can't mask the original outcome.
  • Collapsed the redundant bodyLen > 0 / else branch into one path (slice(0, 0) already yields an empty body) — behavior identical.

Returned values are unaffected: frame.body is an owned slice copy, and the cancel runs after the result is assembled, so cancelling the remaining body can't corrupt what callers receive.

Test plan

  • packages/world-vercel/src/frames.test.ts: new tests asserting the underlying stream is cancelled when the consumer breaks early — for both the async-iterable branch and the getReader/readerToIterator branch — plus a guard that full consumption still decodes every frame. The spyStream helper models a kept-alive socket (highWaterMark: 0, never signals EOF); a toy stream that auto-closes would make cancel() a no-op and give a false pass.
  • packages/world-vercel/src/events-v4.test.ts: new getEventV4 HTTP round-trip via undici MockAgent (this path previously had no test). Includes a trailing frame the reader must never read, proving the early return + cancel returns correct data and doesn't hang.
  • Verified the new tests fail against pre-fix code and pass with the fix.
  • pnpm test (world-vercel): 167 passed. pnpm typecheck and biome check: clean.

Scope

Targets the decodeFrames early-exit leak only. A few lower-frequency error/edge paths (streamer.tsget()/list() throwing without draining; the content-type / missing-header throws in events-v4.ts) are the same class of issue and can be a follow-up.

🤖 Generated with Claude Code

decodeFrames never cancelled response.body when a consumer stopped reading
before EOF — getEventV4 returns after the first frame and consumeListFrameStream
breaks at the sentinel — so the undici connection stayed checked out of the pool
(8 per origin) instead of being released, causing stalls/timeouts on the
event-read path.
Cancel the source in a try/finally (and cancel the reader in readerToIterator)
via a shared closeQuietly helper. Add regression tests for both decode branches
and a getEventV4 HTTP round-trip through undici MockAgent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fc2f47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production114312241368
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7893110748968

❌ Failed Tests

▲ Vercel Production (1 failed)

nuxt (1 failed):

  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nitro125027
❌ nuxt124127
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.043s (+6.1% 🔺)1.006s (~)0.963s101.00x
💻 LocalExpress0.045s (+9.7% 🔺)1.006s (~)0.961s101.04x
💻 LocalNext.js (Turbopack)0.051s (+5.6% 🔺)1.006s (~)0.955s101.17x
🐘 PostgresNext.js (Turbopack)0.054s (-6.2% 🟢)1.011s (~)0.957s101.25x
🐘 PostgresNitro0.065s (+3.3%)1.012s (~)0.947s101.50x
🐘 PostgresExpress0.094s (+53.0% 🔺)1.033s (+2.1%)0.939s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.364s (-8.4% 🟢)2.332s (-4.3%)1.968s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.090s (-0.9%)2.007s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.093s (~)2.007s (~)0.914s101.00x
💻 LocalNitro1.096s (+0.7%)2.007s (~)0.911s101.01x
🐘 PostgresNext.js (Turbopack)1.102s (~)2.011s (~)0.909s101.01x
🐘 PostgresNitro1.112s (+0.7%)2.009s (~)0.897s101.02x
🐘 PostgresExpress1.112s (+0.8%)2.010s (~)0.898s101.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.893s (+24.5% 🔺)3.512s (-1.6%)1.619s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.505s (~)11.012s (~)0.507s31.00x
💻 LocalNitro10.519s (~)11.023s (~)0.504s31.00x
💻 LocalExpress10.523s (~)11.024s (~)0.501s31.00x
🐘 PostgresNext.js (Turbopack)10.527s (~)11.021s (~)0.494s31.00x
💻 LocalNext.js (Turbopack)10.544s (~)11.023s (~)0.479s31.00x
🐘 PostgresNitro10.548s (~)11.018s (~)0.470s31.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express13.799s (+5.4% 🔺)15.362s (+1.0%)1.564s21.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.737s (~)14.018s (~)0.281s51.00x
💻 LocalExpress13.742s (-1.8%)14.027s (-1.4%)0.284s51.00x
💻 LocalNitro13.782s (+0.7%)14.028s (~)0.246s51.00x
🐘 PostgresNitro13.805s (-0.7%)14.018s (~)0.213s51.00x
🐘 PostgresNext.js (Turbopack)13.837s (-0.6%)14.023s (~)0.186s51.01x
💻 LocalNext.js (Turbopack)13.855s (+1.1%)14.028s (~)0.174s51.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express22.314s (+10.7% 🔺)23.407s (+4.4%)1.092s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)12.376s (-1.2%)13.016s (~)0.639s71.00x
💻 LocalExpress12.387s (-1.6%)13.025s (~)0.638s71.00x
🐘 PostgresNitro12.475s (+0.6%)13.022s (~)0.547s71.01x
💻 LocalNext.js (Turbopack)12.485s (~)13.025s (~)0.541s71.01x
💻 LocalNitro12.649s (+2.9%)13.027s (~)0.378s71.02x
🐘 PostgresExpress13.722s (+10.2% 🔺)14.042s (+7.9% 🔺)0.320s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.031s (+34.8% 🔺)33.465s (+33.0% 🔺)2.434s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (~)2.008s (~)0.854s151.00x
🐘 PostgresNitro1.193s (~)2.009s (~)0.816s151.03x
💻 LocalExpress1.223s (-0.6%)2.006s (~)0.783s151.06x
🐘 PostgresExpress1.236s (+3.4%)2.012s (~)0.776s151.07x
💻 LocalNitro1.238s (+2.9%)2.007s (~)0.769s151.07x
💻 LocalNext.js (Turbopack)1.294s (-5.9% 🟢)2.006s (~)0.712s151.12x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.811s (+4.4%)4.319s (-3.1%)1.508s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.264s (+1.0%)2.009s (~)0.744s151.00x
🐘 PostgresExpress1.271s (-2.8%)2.012s (-3.0%)0.741s151.01x
🐘 PostgresNitro1.276s (+0.5%)2.008s (~)0.732s151.01x
💻 LocalNitro2.000s (-0.8%)2.316s (-7.6% 🟢)0.316s131.58x
💻 LocalExpress2.152s (+5.7% 🔺)2.392s (-4.6%)0.241s131.70x
💻 LocalNext.js (Turbopack)2.297s (-2.0%)2.735s (-6.3% 🟢)0.438s111.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.236s (+14.1% 🔺)4.742s (+3.3%)1.506s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.486s (+2.5%)3.762s (+2.2%)2.276s81.00x
🐘 PostgresNext.js (Turbopack)1.516s (+2.3%)3.885s (~)2.369s81.02x
🐘 PostgresExpress1.617s (-2.4%)3.570s (-5.1% 🟢)1.953s91.09x
💻 LocalNitro5.496s (+22.6% 🔺)6.015s (+20.0% 🔺)0.519s53.70x
💻 LocalExpress5.652s (-2.1%)6.016s (-6.2% 🟢)0.364s53.80x
💻 LocalNext.js (Turbopack)6.781s (+1.4%)7.416s (~)0.635s54.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.669s (+117.1% 🔺)8.889s (+80.3% 🔺)2.220s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.144s (-2.5%)2.007s (~)0.864s151.00x
🐘 PostgresExpress1.188s (-0.6%)2.014s (~)0.826s151.04x
🐘 PostgresNitro1.203s (~)2.007s (~)0.804s151.05x
💻 LocalExpress1.204s (-2.1%)2.006s (~)0.802s151.05x
💻 LocalNitro1.231s (~)2.007s (~)0.776s151.08x
💻 LocalNext.js (Turbopack)1.393s (+3.1%)2.006s (~)0.614s151.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.013s (+48.9% 🔺)4.449s (+13.9% 🔺)1.436s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.257s (-0.5%)2.150s (+3.6%)0.893s141.00x
🐘 PostgresExpress1.263s (-2.5%)2.006s (~)0.744s151.00x
🐘 PostgresNitro1.292s (+1.3%)2.008s (~)0.716s151.03x
💻 LocalExpress1.988s (-2.4%)2.470s (-9.8% 🟢)0.482s131.58x
💻 LocalNitro1.997s (-0.6%)2.508s (+8.4% 🔺)0.511s121.59x
💻 LocalNext.js (Turbopack)2.250s (-7.0% 🟢)2.734s (-6.3% 🟢)0.485s111.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.587s (+39.0% 🔺)5.426s (+24.8% 🔺)1.839s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.446s (-0.7%)3.760s (~)2.314s81.00x
🐘 PostgresExpress1.451s (+1.4%)3.677s (-2.2%)2.226s91.00x
🐘 PostgresNext.js (Turbopack)1.477s (+0.5%)4.009s (+3.2%)2.532s81.02x
💻 LocalExpress5.477s (-8.2% 🟢)6.017s (-11.7% 🟢)0.540s53.79x
💻 LocalNitro5.878s (+18.9% 🔺)6.417s (+16.4% 🔺)0.539s54.07x
💻 LocalNext.js (Turbopack)6.700s (-1.3%)7.219s (-3.9%)0.519s54.63x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.783s (+35.9% 🔺)7.504s (+23.1% 🔺)1.721s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.518s (-8.3% 🟢)1.006s (-1.7%)0.488s601.00x
🐘 PostgresExpress0.525s (-8.8% 🟢)1.025s (~)0.500s591.01x
🐘 PostgresNitro0.551s (-2.0%)1.006s (-1.6%)0.456s601.06x
💻 LocalExpress0.572s (-6.3% 🟢)1.005s (~)0.433s601.10x
💻 LocalNext.js (Turbopack)0.585s (-4.4%)1.005s (-1.7%)0.420s601.13x
💻 LocalNitro0.604s (+5.9% 🔺)1.005s (-1.6%)0.401s601.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.117s (+20.0% 🔺)5.558s (+2.4%)1.441s111.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.258s (-1.4%)2.007s (~)0.749s451.00x
🐘 PostgresExpress1.304s (-1.6%)1.946s (-3.1%)0.641s471.04x
🐘 PostgresNitro1.310s (+2.8%)2.008s (~)0.698s451.04x
💻 LocalExpress1.493s (-4.2%)2.028s (~)0.535s451.19x
💻 LocalNext.js (Turbopack)1.506s (+2.1%)2.006s (~)0.500s451.20x
💻 LocalNitro1.506s (+8.9% 🔺)2.007s (~)0.500s451.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express10.059s (+17.3% 🔺)12.286s (+17.8% 🔺)2.227s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.356s (-10.6% 🟢)2.984s (-2.4%)0.628s411.00x
🐘 PostgresNext.js (Turbopack)2.527s (-0.9%)3.009s (~)0.482s401.07x
🐘 PostgresNitro2.608s (-1.7%)3.059s (-2.5%)0.451s401.11x
💻 LocalExpress3.231s (-0.6%)3.977s (-0.8%)0.746s311.37x
💻 LocalNext.js (Turbopack)3.258s (+1.7%)4.010s (+0.8%)0.751s301.38x
💻 LocalNitro3.296s (+10.0% 🔺)4.010s (+16.7% 🔺)0.714s301.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.195s (+27.6% 🔺)21.256s (+23.4% 🔺)2.061s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.167s (-6.5% 🟢)1.007s (~)0.840s601.00x
🐘 PostgresExpress0.200s (-8.5% 🟢)1.012s (+0.6%)0.812s601.20x
🐘 PostgresNitro0.229s (+8.3% 🔺)1.006s (~)0.777s601.37x
💻 LocalExpress0.345s (+1.0%)1.005s (~)0.660s602.06x
💻 LocalNitro0.358s (+6.0% 🔺)1.005s (~)0.647s602.14x
💻 LocalNext.js (Turbopack)0.633s (+4.6%)1.039s (+3.4%)0.406s583.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.608s (+27.1% 🔺)3.173s (+7.4% 🔺)1.565s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.271s (+1.1%)1.029s (+2.3%)0.758s881.00x
🐘 PostgresNitro0.345s (+6.7% 🔺)1.007s (~)0.662s901.27x
🐘 PostgresExpress0.514s (+60.2% 🔺)1.043s (+3.7%)0.529s871.90x
💻 LocalNitro2.066s (+2.0%)2.537s (+2.8%)0.471s367.62x
💻 LocalExpress2.070s (+5.8% 🔺)2.470s (~)0.400s377.64x
💻 LocalNext.js (Turbopack)2.643s (-0.9%)3.296s (+7.2% 🔺)0.652s289.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.327s (+37.2% 🔺)4.125s (+16.7% 🔺)1.798s231.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s (+0.8%)2.936s (-3.2%)2.451s411.00x
🐘 PostgresNitro0.516s (-1.7%)1.068s (+1.8%)0.553s1131.06x
🐘 PostgresExpress0.579s (+17.4% 🔺)1.120s (+10.4% 🔺)0.541s1081.19x
💻 LocalNitro9.822s (+5.0%)10.445s (+3.3%)0.622s1220.23x
💻 LocalExpress9.969s (+1.9%)10.695s (+0.8%)0.726s1220.53x
💻 LocalNext.js (Turbopack)11.201s (+11.3% 🔺)12.131s (+9.1% 🔺)0.929s1023.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.258s (+75.6% 🔺)6.218s (+42.1% 🔺)1.959s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (-1.3%)2.001s (~)0.001s (~)2.011s (~)0.856s101.00x
💻 LocalNext.js (Turbopack)1.157s (~)2.003s (~)0.012s (-3.2%)2.019s (~)0.862s101.00x
💻 LocalExpress1.169s (~)2.005s (~)0.012s (-4.1%)2.020s (~)0.851s101.01x
💻 LocalNitro1.171s (+1.8%)2.005s (~)0.013s (+37.0% 🔺)2.020s (~)0.850s101.01x
🐘 PostgresNitro1.176s (+0.6%)1.995s (~)0.001s (-31.6% 🟢)2.011s (~)0.835s101.02x
🐘 PostgresExpress1.269s (+7.7% 🔺)1.971s (-1.2%)0.001s (-42.9% 🟢)2.029s (+0.9%)0.760s101.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.523s (+11.7% 🔺)3.515s (+3.1%)2.599s (-4.0%)6.612s (-3.0%)4.090s101.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.576s (-0.5%)2.010s (~)0.012s (~)2.025s (~)0.449s301.00x
🐘 PostgresNext.js (Turbopack)1.595s (~)2.010s (~)0.005s (+10.1% 🔺)2.026s (~)0.430s301.01x
🐘 PostgresNitro1.599s (-2.6%)2.005s (-1.6%)0.005s (+1.3%)2.027s (-1.5%)0.428s301.01x
💻 LocalNitro1.611s (+2.0%)2.010s (~)0.012s (~)2.025s (~)0.415s301.02x
💻 LocalNext.js (Turbopack)1.645s (+1.7%)2.008s (~)0.013s (-1.6%)2.025s (~)0.380s301.04x
🐘 PostgresExpress1.722s (+8.6% 🔺)2.144s (+7.0% 🔺)0.004s (-15.1% 🟢)2.169s (+7.0% 🔺)0.447s281.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.853s (+11.7% 🔺)8.340s (+6.3% 🔺)0.224s (-21.0% 🟢)9.063s (+4.5%)2.210s71.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.793s (+3.1%)1.070s (-3.1%)0.000s (-1.8%)1.097s (-1.9%)0.304s551.00x
🐘 PostgresNext.js (Turbopack)0.810s (+6.4% 🔺)1.111s (+2.1%)0.000s (+111.1% 🔺)1.119s (+2.1%)0.309s541.02x
🐘 PostgresExpress1.124s (+47.2% 🔺)1.532s (+44.0% 🔺)0.000s (+Infinity% 🔺)1.560s (+44.6% 🔺)0.436s391.42x
💻 LocalExpress1.361s (+2.9%)2.013s (~)0.001s (+54.5% 🔺)2.016s (~)0.655s301.72x
💻 LocalNitro1.377s (+0.9%)2.014s (~)0.001s (+50.0% 🔺)2.017s (~)0.640s301.74x
💻 LocalNext.js (Turbopack)1.496s (+3.3%)2.013s (~)0.001s (+77.8% 🔺)2.017s (~)0.521s301.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.729s (+10.4% 🔺)4.651s (-7.8% 🟢)0.000s (-54.2% 🟢)5.149s (-7.5% 🟢)1.419s121.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.578s (-4.7%)2.257s (+1.9%)0.000s (-100.0% 🟢)2.289s (+2.6%)0.711s271.00x
🐘 PostgresNext.js (Turbopack)1.935s (+1.4%)2.544s (~)0.000s (+Infinity% 🔺)2.552s (~)0.617s241.23x
🐘 PostgresExpress2.497s (+63.3% 🔺)3.006s (+43.1% 🔺)0.000s (+33.3% 🔺)3.068s (+42.6% 🔺)0.571s211.58x
💻 LocalExpress3.453s (-5.2% 🟢)3.965s (-6.2% 🟢)0.000s (-43.7% 🟢)3.969s (-6.2% 🟢)0.517s162.19x
💻 LocalNitro3.647s (+4.2%)4.092s (+3.3%)0.000s (-64.4% 🟢)4.099s (+3.2%)0.452s152.31x
💻 LocalNext.js (Turbopack)3.962s (-3.8%)4.529s (-1.5%)0.000s (-72.2% 🟢)4.534s (-1.6%)0.572s142.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.001s (-27.3% 🟢)7.053s (-28.6% 🟢)0.000s (-100.0% 🟢)7.582s (-27.4% 🟢)1.581s81.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress14/21
🐘 PostgresNext.js (Turbopack)14/21
▲ VercelExpress21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres15/21
Next.js (Turbopack)🐘 Postgres19/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@vercel
vercelBot requested a deployment to Preview – workbench-express-workflow June 20, 2026 19:05 Abandoned
@smaeda-ks
smaeda-ks marked this pull request as ready for review June 20, 2026 19:12
@smaeda-ks
smaeda-ks requested a review from a team as a code ownerJune 20, 2026 19:12
@VaguelySerious
VaguelySerious merged commit e3672e8 into mainJun 20, 2026
113 of 119 checks passed
@VaguelySerious
VaguelySerious deleted the shohei/conn-leak branch June 20, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for e3672e8 (AI decision).

This fix targets the decodeFrames/readerToIterator machinery in packages/world-vercel/src/frames.ts (and tests in frames.test.ts / events-v4.test.ts), none of which exist on stable — verified that stable has no frames.ts, no events-v4.*, and an events.ts with no streaming/frame-decoding logic at all. The v4 frame-stream wire format is main-only, so the bug being fixed does not exist on stable and the change cannot apply there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

e3672e84f4996fbd35fc2542d11d401979d76924

pranaygp added a commit that referenced this pull request Jun 22, 2026
…testing
* origin/main:
Version Packages (beta) (#2540)
perf(core): memoize step return value hydration across inline replays (#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (#2412)
Amend lazy discovery removal changeset (#2560)
[docs] Document minimum SDK version for using hook.getConflict (#2423)
Update default CODEOWNERS (#2556)
Optimize and fix the default eager build mode (#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (#2547)" (#2554)
[core] Turbo mode: fast-path the first invocation (#2526)
Remove lazy discovery from workflow/next (#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (#2547)
feat(docs): add eve and AI SDK to product switcher (#2543)
[vitest] Fix local imports failing to load in test step bundles (#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (#2324)
Version Packages (beta) (#2495)
otel(world-vercel): inject trace context on v4 event requests (#2533)
Bump undici to 7.28.0 (#2534)
Default source maps to dev-on / prod-off (#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (#2527)
perf(core): parallel inline steps + optimistic lazy step start (#2516)
pranaygp added a commit to marcopiraccini/workflow that referenced this pull request Jun 22, 2026
* origin/main: (120 commits)
Version Packages (beta) (vercel#2540)
perf(core): memoize step return value hydration across inline replays (vercel#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (vercel#2412)
Amend lazy discovery removal changeset (vercel#2560)
[docs] Document minimum SDK version for using hook.getConflict (vercel#2423)
Update default CODEOWNERS (vercel#2556)
Optimize and fix the default eager build mode (vercel#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)" (vercel#2554)
[core] Turbo mode: fast-path the first invocation (vercel#2526)
Remove lazy discovery from workflow/next (vercel#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)
feat(docs): add eve and AI SDK to product switcher (vercel#2543)
[vitest] Fix local imports failing to load in test step bundles (vercel#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (vercel#2324)
Version Packages (beta) (vercel#2495)
otel(world-vercel): inject trace context on v4 event requests (vercel#2533)
Bump undici to 7.28.0 (vercel#2534)
Default source maps to dev-on / prod-off (vercel#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (vercel#2527)
perf(core): parallel inline steps + optimistic lazy step start (vercel#2516)
...
VaguelySerious added a commit that referenced this pull request Jul 10, 2026
The straight reapply of #2547 awaited chunks.return?.()/reader.cancel()
in decodeFrames' finally block, blocking every early-exit caller
(getEventV4, every replay's list read) on the cancel's completion. On
Vercel's Next.js (turbopack + webpack) Function lanes this hung
indefinitely — confirmed via CI: every single E2E Vercel Prod run got
stuck in "running" after its step completed, for the full 30-minute
window, while all other frameworks passed cleanly in ~15 minutes.
Same failure signature and same two CI lanes as #2807's awaited
reader.cancel() bug in the core abort-stream reader — very likely the
actual (undocumented) reason #2547 was reverted. Fix: fire-and-forget
the cancel, matching #2807's pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@smaeda-ks@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections by smaeda-ks · Pull Request #2547 · vercel/workflow · GitHub
Skip to content

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections - #2547

Merged
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak
Jun 20, 2026
Merged

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections#2547
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak

Conversation

@smaeda-ks

@smaeda-kssmaeda-ks commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

decodeFrames (the v4 event frame-stream reader) never cancelled its underlying response.body when a consumer stopped reading before EOF. With Node's fetch/undici, a response body that is neither fully drained nor cancelled keeps its socket checked out of the connection pool — so every such read leaks a connection until keepalive timeout/GC.

Two live read paths stop early by design and hit this:

CallerEarly exitFrequency
getEventV4returns after the first frame (single-frame response)per event read
consumeListFrameStream (getWorkflowRunEventsV4 / getEventsByCorrelationIdV4)breaks at the {_end:1} sentinelper event-list, i.e. ~every replay

This is the v4 wire format that events.ts uses "throughout" (it replaced the v2/v3 readers), so the leak is on the current, hot replay path — not legacy code.

Why it matters

In production every event read goes to a single origin — vercel-workflow.com (direct) or api.vercel.com (proxy) — and the dispatcher caps that origin at connections: 8 (HTTP/1.1). A leaked body holds its connection "in use," so it isn't returned to the pool. Pin ~8 of them and the pool is saturated: subsequent reads queue until a connection frees (the dropped response is GC-reclaimed, or the 60s request timeout fires). The user-visible result is intermittent stalls and timeouts on the event-read path; because each pinned connection ends up single-use instead of kept-alive, connection churn rises too.

Fix

packages/world-vercel/src/frames.ts:

  • Wrap the decodeFrames read loop in try/finally and call chunks.return?.() on exit, which cancels the source stream (releasing the socket) on early break/return, normal completion, and error paths alike. No-op once drained.
  • readerToIterator now cancels its reader in a finally (the non-async-iterable fallback branch).
  • Both share a small internal closeQuietly helper that swallows only cleanup errors, so it can't mask the original outcome.
  • Collapsed the redundant bodyLen > 0 / else branch into one path (slice(0, 0) already yields an empty body) — behavior identical.

Returned values are unaffected: frame.body is an owned slice copy, and the cancel runs after the result is assembled, so cancelling the remaining body can't corrupt what callers receive.

Test plan

  • packages/world-vercel/src/frames.test.ts: new tests asserting the underlying stream is cancelled when the consumer breaks early — for both the async-iterable branch and the getReader/readerToIterator branch — plus a guard that full consumption still decodes every frame. The spyStream helper models a kept-alive socket (highWaterMark: 0, never signals EOF); a toy stream that auto-closes would make cancel() a no-op and give a false pass.
  • packages/world-vercel/src/events-v4.test.ts: new getEventV4 HTTP round-trip via undici MockAgent (this path previously had no test). Includes a trailing frame the reader must never read, proving the early return + cancel returns correct data and doesn't hang.
  • Verified the new tests fail against pre-fix code and pass with the fix.
  • pnpm test (world-vercel): 167 passed. pnpm typecheck and biome check: clean.

Scope

Targets the decodeFrames early-exit leak only. A few lower-frequency error/edge paths (streamer.tsget()/list() throwing without draining; the content-type / missing-header throws in events-v4.ts) are the same class of issue and can be a follow-up.

🤖 Generated with Claude Code

decodeFrames never cancelled response.body when a consumer stopped reading
before EOF — getEventV4 returns after the first frame and consumeListFrameStream
breaks at the sentinel — so the undici connection stayed checked out of the pool
(8 per origin) instead of being released, causing stalls/timeouts on the
event-read path.
Cancel the source in a try/finally (and cancel the reader in readerToIterator)
via a shared closeQuietly helper. Add regression tests for both decode branches
and a getEventV4 HTTP round-trip through undici MockAgent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fc2f47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production114312241368
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7893110748968

❌ Failed Tests

▲ Vercel Production (1 failed)

nuxt (1 failed):

  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nitro125027
❌ nuxt124127
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.043s (+6.1% 🔺)1.006s (~)0.963s101.00x
💻 LocalExpress0.045s (+9.7% 🔺)1.006s (~)0.961s101.04x
💻 LocalNext.js (Turbopack)0.051s (+5.6% 🔺)1.006s (~)0.955s101.17x
🐘 PostgresNext.js (Turbopack)0.054s (-6.2% 🟢)1.011s (~)0.957s101.25x
🐘 PostgresNitro0.065s (+3.3%)1.012s (~)0.947s101.50x
🐘 PostgresExpress0.094s (+53.0% 🔺)1.033s (+2.1%)0.939s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.364s (-8.4% 🟢)2.332s (-4.3%)1.968s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.090s (-0.9%)2.007s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.093s (~)2.007s (~)0.914s101.00x
💻 LocalNitro1.096s (+0.7%)2.007s (~)0.911s101.01x
🐘 PostgresNext.js (Turbopack)1.102s (~)2.011s (~)0.909s101.01x
🐘 PostgresNitro1.112s (+0.7%)2.009s (~)0.897s101.02x
🐘 PostgresExpress1.112s (+0.8%)2.010s (~)0.898s101.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.893s (+24.5% 🔺)3.512s (-1.6%)1.619s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.505s (~)11.012s (~)0.507s31.00x
💻 LocalNitro10.519s (~)11.023s (~)0.504s31.00x
💻 LocalExpress10.523s (~)11.024s (~)0.501s31.00x
🐘 PostgresNext.js (Turbopack)10.527s (~)11.021s (~)0.494s31.00x
💻 LocalNext.js (Turbopack)10.544s (~)11.023s (~)0.479s31.00x
🐘 PostgresNitro10.548s (~)11.018s (~)0.470s31.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express13.799s (+5.4% 🔺)15.362s (+1.0%)1.564s21.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.737s (~)14.018s (~)0.281s51.00x
💻 LocalExpress13.742s (-1.8%)14.027s (-1.4%)0.284s51.00x
💻 LocalNitro13.782s (+0.7%)14.028s (~)0.246s51.00x
🐘 PostgresNitro13.805s (-0.7%)14.018s (~)0.213s51.00x
🐘 PostgresNext.js (Turbopack)13.837s (-0.6%)14.023s (~)0.186s51.01x
💻 LocalNext.js (Turbopack)13.855s (+1.1%)14.028s (~)0.174s51.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express22.314s (+10.7% 🔺)23.407s (+4.4%)1.092s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)12.376s (-1.2%)13.016s (~)0.639s71.00x
💻 LocalExpress12.387s (-1.6%)13.025s (~)0.638s71.00x
🐘 PostgresNitro12.475s (+0.6%)13.022s (~)0.547s71.01x
💻 LocalNext.js (Turbopack)12.485s (~)13.025s (~)0.541s71.01x
💻 LocalNitro12.649s (+2.9%)13.027s (~)0.378s71.02x
🐘 PostgresExpress13.722s (+10.2% 🔺)14.042s (+7.9% 🔺)0.320s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.031s (+34.8% 🔺)33.465s (+33.0% 🔺)2.434s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (~)2.008s (~)0.854s151.00x
🐘 PostgresNitro1.193s (~)2.009s (~)0.816s151.03x
💻 LocalExpress1.223s (-0.6%)2.006s (~)0.783s151.06x
🐘 PostgresExpress1.236s (+3.4%)2.012s (~)0.776s151.07x
💻 LocalNitro1.238s (+2.9%)2.007s (~)0.769s151.07x
💻 LocalNext.js (Turbopack)1.294s (-5.9% 🟢)2.006s (~)0.712s151.12x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.811s (+4.4%)4.319s (-3.1%)1.508s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.264s (+1.0%)2.009s (~)0.744s151.00x
🐘 PostgresExpress1.271s (-2.8%)2.012s (-3.0%)0.741s151.01x
🐘 PostgresNitro1.276s (+0.5%)2.008s (~)0.732s151.01x
💻 LocalNitro2.000s (-0.8%)2.316s (-7.6% 🟢)0.316s131.58x
💻 LocalExpress2.152s (+5.7% 🔺)2.392s (-4.6%)0.241s131.70x
💻 LocalNext.js (Turbopack)2.297s (-2.0%)2.735s (-6.3% 🟢)0.438s111.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.236s (+14.1% 🔺)4.742s (+3.3%)1.506s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.486s (+2.5%)3.762s (+2.2%)2.276s81.00x
🐘 PostgresNext.js (Turbopack)1.516s (+2.3%)3.885s (~)2.369s81.02x
🐘 PostgresExpress1.617s (-2.4%)3.570s (-5.1% 🟢)1.953s91.09x
💻 LocalNitro5.496s (+22.6% 🔺)6.015s (+20.0% 🔺)0.519s53.70x
💻 LocalExpress5.652s (-2.1%)6.016s (-6.2% 🟢)0.364s53.80x
💻 LocalNext.js (Turbopack)6.781s (+1.4%)7.416s (~)0.635s54.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.669s (+117.1% 🔺)8.889s (+80.3% 🔺)2.220s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.144s (-2.5%)2.007s (~)0.864s151.00x
🐘 PostgresExpress1.188s (-0.6%)2.014s (~)0.826s151.04x
🐘 PostgresNitro1.203s (~)2.007s (~)0.804s151.05x
💻 LocalExpress1.204s (-2.1%)2.006s (~)0.802s151.05x
💻 LocalNitro1.231s (~)2.007s (~)0.776s151.08x
💻 LocalNext.js (Turbopack)1.393s (+3.1%)2.006s (~)0.614s151.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.013s (+48.9% 🔺)4.449s (+13.9% 🔺)1.436s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.257s (-0.5%)2.150s (+3.6%)0.893s141.00x
🐘 PostgresExpress1.263s (-2.5%)2.006s (~)0.744s151.00x
🐘 PostgresNitro1.292s (+1.3%)2.008s (~)0.716s151.03x
💻 LocalExpress1.988s (-2.4%)2.470s (-9.8% 🟢)0.482s131.58x
💻 LocalNitro1.997s (-0.6%)2.508s (+8.4% 🔺)0.511s121.59x
💻 LocalNext.js (Turbopack)2.250s (-7.0% 🟢)2.734s (-6.3% 🟢)0.485s111.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.587s (+39.0% 🔺)5.426s (+24.8% 🔺)1.839s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.446s (-0.7%)3.760s (~)2.314s81.00x
🐘 PostgresExpress1.451s (+1.4%)3.677s (-2.2%)2.226s91.00x
🐘 PostgresNext.js (Turbopack)1.477s (+0.5%)4.009s (+3.2%)2.532s81.02x
💻 LocalExpress5.477s (-8.2% 🟢)6.017s (-11.7% 🟢)0.540s53.79x
💻 LocalNitro5.878s (+18.9% 🔺)6.417s (+16.4% 🔺)0.539s54.07x
💻 LocalNext.js (Turbopack)6.700s (-1.3%)7.219s (-3.9%)0.519s54.63x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.783s (+35.9% 🔺)7.504s (+23.1% 🔺)1.721s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.518s (-8.3% 🟢)1.006s (-1.7%)0.488s601.00x
🐘 PostgresExpress0.525s (-8.8% 🟢)1.025s (~)0.500s591.01x
🐘 PostgresNitro0.551s (-2.0%)1.006s (-1.6%)0.456s601.06x
💻 LocalExpress0.572s (-6.3% 🟢)1.005s (~)0.433s601.10x
💻 LocalNext.js (Turbopack)0.585s (-4.4%)1.005s (-1.7%)0.420s601.13x
💻 LocalNitro0.604s (+5.9% 🔺)1.005s (-1.6%)0.401s601.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.117s (+20.0% 🔺)5.558s (+2.4%)1.441s111.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.258s (-1.4%)2.007s (~)0.749s451.00x
🐘 PostgresExpress1.304s (-1.6%)1.946s (-3.1%)0.641s471.04x
🐘 PostgresNitro1.310s (+2.8%)2.008s (~)0.698s451.04x
💻 LocalExpress1.493s (-4.2%)2.028s (~)0.535s451.19x
💻 LocalNext.js (Turbopack)1.506s (+2.1%)2.006s (~)0.500s451.20x
💻 LocalNitro1.506s (+8.9% 🔺)2.007s (~)0.500s451.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express10.059s (+17.3% 🔺)12.286s (+17.8% 🔺)2.227s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.356s (-10.6% 🟢)2.984s (-2.4%)0.628s411.00x
🐘 PostgresNext.js (Turbopack)2.527s (-0.9%)3.009s (~)0.482s401.07x
🐘 PostgresNitro2.608s (-1.7%)3.059s (-2.5%)0.451s401.11x
💻 LocalExpress3.231s (-0.6%)3.977s (-0.8%)0.746s311.37x
💻 LocalNext.js (Turbopack)3.258s (+1.7%)4.010s (+0.8%)0.751s301.38x
💻 LocalNitro3.296s (+10.0% 🔺)4.010s (+16.7% 🔺)0.714s301.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.195s (+27.6% 🔺)21.256s (+23.4% 🔺)2.061s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.167s (-6.5% 🟢)1.007s (~)0.840s601.00x
🐘 PostgresExpress0.200s (-8.5% 🟢)1.012s (+0.6%)0.812s601.20x
🐘 PostgresNitro0.229s (+8.3% 🔺)1.006s (~)0.777s601.37x
💻 LocalExpress0.345s (+1.0%)1.005s (~)0.660s602.06x
💻 LocalNitro0.358s (+6.0% 🔺)1.005s (~)0.647s602.14x
💻 LocalNext.js (Turbopack)0.633s (+4.6%)1.039s (+3.4%)0.406s583.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.608s (+27.1% 🔺)3.173s (+7.4% 🔺)1.565s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.271s (+1.1%)1.029s (+2.3%)0.758s881.00x
🐘 PostgresNitro0.345s (+6.7% 🔺)1.007s (~)0.662s901.27x
🐘 PostgresExpress0.514s (+60.2% 🔺)1.043s (+3.7%)0.529s871.90x
💻 LocalNitro2.066s (+2.0%)2.537s (+2.8%)0.471s367.62x
💻 LocalExpress2.070s (+5.8% 🔺)2.470s (~)0.400s377.64x
💻 LocalNext.js (Turbopack)2.643s (-0.9%)3.296s (+7.2% 🔺)0.652s289.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.327s (+37.2% 🔺)4.125s (+16.7% 🔺)1.798s231.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s (+0.8%)2.936s (-3.2%)2.451s411.00x
🐘 PostgresNitro0.516s (-1.7%)1.068s (+1.8%)0.553s1131.06x
🐘 PostgresExpress0.579s (+17.4% 🔺)1.120s (+10.4% 🔺)0.541s1081.19x
💻 LocalNitro9.822s (+5.0%)10.445s (+3.3%)0.622s1220.23x
💻 LocalExpress9.969s (+1.9%)10.695s (+0.8%)0.726s1220.53x
💻 LocalNext.js (Turbopack)11.201s (+11.3% 🔺)12.131s (+9.1% 🔺)0.929s1023.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.258s (+75.6% 🔺)6.218s (+42.1% 🔺)1.959s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (-1.3%)2.001s (~)0.001s (~)2.011s (~)0.856s101.00x
💻 LocalNext.js (Turbopack)1.157s (~)2.003s (~)0.012s (-3.2%)2.019s (~)0.862s101.00x
💻 LocalExpress1.169s (~)2.005s (~)0.012s (-4.1%)2.020s (~)0.851s101.01x
💻 LocalNitro1.171s (+1.8%)2.005s (~)0.013s (+37.0% 🔺)2.020s (~)0.850s101.01x
🐘 PostgresNitro1.176s (+0.6%)1.995s (~)0.001s (-31.6% 🟢)2.011s (~)0.835s101.02x
🐘 PostgresExpress1.269s (+7.7% 🔺)1.971s (-1.2%)0.001s (-42.9% 🟢)2.029s (+0.9%)0.760s101.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.523s (+11.7% 🔺)3.515s (+3.1%)2.599s (-4.0%)6.612s (-3.0%)4.090s101.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.576s (-0.5%)2.010s (~)0.012s (~)2.025s (~)0.449s301.00x
🐘 PostgresNext.js (Turbopack)1.595s (~)2.010s (~)0.005s (+10.1% 🔺)2.026s (~)0.430s301.01x
🐘 PostgresNitro1.599s (-2.6%)2.005s (-1.6%)0.005s (+1.3%)2.027s (-1.5%)0.428s301.01x
💻 LocalNitro1.611s (+2.0%)2.010s (~)0.012s (~)2.025s (~)0.415s301.02x
💻 LocalNext.js (Turbopack)1.645s (+1.7%)2.008s (~)0.013s (-1.6%)2.025s (~)0.380s301.04x
🐘 PostgresExpress1.722s (+8.6% 🔺)2.144s (+7.0% 🔺)0.004s (-15.1% 🟢)2.169s (+7.0% 🔺)0.447s281.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.853s (+11.7% 🔺)8.340s (+6.3% 🔺)0.224s (-21.0% 🟢)9.063s (+4.5%)2.210s71.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.793s (+3.1%)1.070s (-3.1%)0.000s (-1.8%)1.097s (-1.9%)0.304s551.00x
🐘 PostgresNext.js (Turbopack)0.810s (+6.4% 🔺)1.111s (+2.1%)0.000s (+111.1% 🔺)1.119s (+2.1%)0.309s541.02x
🐘 PostgresExpress1.124s (+47.2% 🔺)1.532s (+44.0% 🔺)0.000s (+Infinity% 🔺)1.560s (+44.6% 🔺)0.436s391.42x
💻 LocalExpress1.361s (+2.9%)2.013s (~)0.001s (+54.5% 🔺)2.016s (~)0.655s301.72x
💻 LocalNitro1.377s (+0.9%)2.014s (~)0.001s (+50.0% 🔺)2.017s (~)0.640s301.74x
💻 LocalNext.js (Turbopack)1.496s (+3.3%)2.013s (~)0.001s (+77.8% 🔺)2.017s (~)0.521s301.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.729s (+10.4% 🔺)4.651s (-7.8% 🟢)0.000s (-54.2% 🟢)5.149s (-7.5% 🟢)1.419s121.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.578s (-4.7%)2.257s (+1.9%)0.000s (-100.0% 🟢)2.289s (+2.6%)0.711s271.00x
🐘 PostgresNext.js (Turbopack)1.935s (+1.4%)2.544s (~)0.000s (+Infinity% 🔺)2.552s (~)0.617s241.23x
🐘 PostgresExpress2.497s (+63.3% 🔺)3.006s (+43.1% 🔺)0.000s (+33.3% 🔺)3.068s (+42.6% 🔺)0.571s211.58x
💻 LocalExpress3.453s (-5.2% 🟢)3.965s (-6.2% 🟢)0.000s (-43.7% 🟢)3.969s (-6.2% 🟢)0.517s162.19x
💻 LocalNitro3.647s (+4.2%)4.092s (+3.3%)0.000s (-64.4% 🟢)4.099s (+3.2%)0.452s152.31x
💻 LocalNext.js (Turbopack)3.962s (-3.8%)4.529s (-1.5%)0.000s (-72.2% 🟢)4.534s (-1.6%)0.572s142.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.001s (-27.3% 🟢)7.053s (-28.6% 🟢)0.000s (-100.0% 🟢)7.582s (-27.4% 🟢)1.581s81.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress14/21
🐘 PostgresNext.js (Turbopack)14/21
▲ VercelExpress21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres15/21
Next.js (Turbopack)🐘 Postgres19/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@vercel
vercelBot requested a deployment to Preview – workbench-express-workflow June 20, 2026 19:05 Abandoned
@smaeda-ks
smaeda-ks marked this pull request as ready for review June 20, 2026 19:12
@smaeda-ks
smaeda-ks requested a review from a team as a code ownerJune 20, 2026 19:12
@VaguelySerious
VaguelySerious merged commit e3672e8 into mainJun 20, 2026
113 of 119 checks passed
@VaguelySerious
VaguelySerious deleted the shohei/conn-leak branch June 20, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for e3672e8 (AI decision).

This fix targets the decodeFrames/readerToIterator machinery in packages/world-vercel/src/frames.ts (and tests in frames.test.ts / events-v4.test.ts), none of which exist on stable — verified that stable has no frames.ts, no events-v4.*, and an events.ts with no streaming/frame-decoding logic at all. The v4 frame-stream wire format is main-only, so the bug being fixed does not exist on stable and the change cannot apply there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

e3672e84f4996fbd35fc2542d11d401979d76924

pranaygp added a commit that referenced this pull request Jun 22, 2026
…testing
* origin/main:
Version Packages (beta) (#2540)
perf(core): memoize step return value hydration across inline replays (#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (#2412)
Amend lazy discovery removal changeset (#2560)
[docs] Document minimum SDK version for using hook.getConflict (#2423)
Update default CODEOWNERS (#2556)
Optimize and fix the default eager build mode (#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (#2547)" (#2554)
[core] Turbo mode: fast-path the first invocation (#2526)
Remove lazy discovery from workflow/next (#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (#2547)
feat(docs): add eve and AI SDK to product switcher (#2543)
[vitest] Fix local imports failing to load in test step bundles (#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (#2324)
Version Packages (beta) (#2495)
otel(world-vercel): inject trace context on v4 event requests (#2533)
Bump undici to 7.28.0 (#2534)
Default source maps to dev-on / prod-off (#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (#2527)
perf(core): parallel inline steps + optimistic lazy step start (#2516)
pranaygp added a commit to marcopiraccini/workflow that referenced this pull request Jun 22, 2026
* origin/main: (120 commits)
Version Packages (beta) (vercel#2540)
perf(core): memoize step return value hydration across inline replays (vercel#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (vercel#2412)
Amend lazy discovery removal changeset (vercel#2560)
[docs] Document minimum SDK version for using hook.getConflict (vercel#2423)
Update default CODEOWNERS (vercel#2556)
Optimize and fix the default eager build mode (vercel#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)" (vercel#2554)
[core] Turbo mode: fast-path the first invocation (vercel#2526)
Remove lazy discovery from workflow/next (vercel#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)
feat(docs): add eve and AI SDK to product switcher (vercel#2543)
[vitest] Fix local imports failing to load in test step bundles (vercel#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (vercel#2324)
Version Packages (beta) (vercel#2495)
otel(world-vercel): inject trace context on v4 event requests (vercel#2533)
Bump undici to 7.28.0 (vercel#2534)
Default source maps to dev-on / prod-off (vercel#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (vercel#2527)
perf(core): parallel inline steps + optimistic lazy step start (vercel#2516)
...
VaguelySerious added a commit that referenced this pull request Jul 10, 2026
The straight reapply of #2547 awaited chunks.return?.()/reader.cancel()
in decodeFrames' finally block, blocking every early-exit caller
(getEventV4, every replay's list read) on the cancel's completion. On
Vercel's Next.js (turbopack + webpack) Function lanes this hung
indefinitely — confirmed via CI: every single E2E Vercel Prod run got
stuck in "running" after its step completed, for the full 30-minute
window, while all other frameworks passed cleanly in ~15 minutes.
Same failure signature and same two CI lanes as #2807's awaited
reader.cancel() bug in the core abort-stream reader — very likely the
actual (undocumented) reason #2547 was reverted. Fix: fire-and-forget
the cancel, matching #2807's pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@smaeda-ks@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections by smaeda-ks · Pull Request #2547 · vercel/workflow · GitHub
Skip to content

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections - #2547

Merged
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak
Jun 20, 2026
Merged

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections#2547
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak

Conversation

@smaeda-ks

@smaeda-kssmaeda-ks commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

decodeFrames (the v4 event frame-stream reader) never cancelled its underlying response.body when a consumer stopped reading before EOF. With Node's fetch/undici, a response body that is neither fully drained nor cancelled keeps its socket checked out of the connection pool — so every such read leaks a connection until keepalive timeout/GC.

Two live read paths stop early by design and hit this:

CallerEarly exitFrequency
getEventV4returns after the first frame (single-frame response)per event read
consumeListFrameStream (getWorkflowRunEventsV4 / getEventsByCorrelationIdV4)breaks at the {_end:1} sentinelper event-list, i.e. ~every replay

This is the v4 wire format that events.ts uses "throughout" (it replaced the v2/v3 readers), so the leak is on the current, hot replay path — not legacy code.

Why it matters

In production every event read goes to a single origin — vercel-workflow.com (direct) or api.vercel.com (proxy) — and the dispatcher caps that origin at connections: 8 (HTTP/1.1). A leaked body holds its connection "in use," so it isn't returned to the pool. Pin ~8 of them and the pool is saturated: subsequent reads queue until a connection frees (the dropped response is GC-reclaimed, or the 60s request timeout fires). The user-visible result is intermittent stalls and timeouts on the event-read path; because each pinned connection ends up single-use instead of kept-alive, connection churn rises too.

Fix

packages/world-vercel/src/frames.ts:

  • Wrap the decodeFrames read loop in try/finally and call chunks.return?.() on exit, which cancels the source stream (releasing the socket) on early break/return, normal completion, and error paths alike. No-op once drained.
  • readerToIterator now cancels its reader in a finally (the non-async-iterable fallback branch).
  • Both share a small internal closeQuietly helper that swallows only cleanup errors, so it can't mask the original outcome.
  • Collapsed the redundant bodyLen > 0 / else branch into one path (slice(0, 0) already yields an empty body) — behavior identical.

Returned values are unaffected: frame.body is an owned slice copy, and the cancel runs after the result is assembled, so cancelling the remaining body can't corrupt what callers receive.

Test plan

  • packages/world-vercel/src/frames.test.ts: new tests asserting the underlying stream is cancelled when the consumer breaks early — for both the async-iterable branch and the getReader/readerToIterator branch — plus a guard that full consumption still decodes every frame. The spyStream helper models a kept-alive socket (highWaterMark: 0, never signals EOF); a toy stream that auto-closes would make cancel() a no-op and give a false pass.
  • packages/world-vercel/src/events-v4.test.ts: new getEventV4 HTTP round-trip via undici MockAgent (this path previously had no test). Includes a trailing frame the reader must never read, proving the early return + cancel returns correct data and doesn't hang.
  • Verified the new tests fail against pre-fix code and pass with the fix.
  • pnpm test (world-vercel): 167 passed. pnpm typecheck and biome check: clean.

Scope

Targets the decodeFrames early-exit leak only. A few lower-frequency error/edge paths (streamer.tsget()/list() throwing without draining; the content-type / missing-header throws in events-v4.ts) are the same class of issue and can be a follow-up.

🤖 Generated with Claude Code

decodeFrames never cancelled response.body when a consumer stopped reading
before EOF — getEventV4 returns after the first frame and consumeListFrameStream
breaks at the sentinel — so the undici connection stayed checked out of the pool
(8 per origin) instead of being released, causing stalls/timeouts on the
event-read path.
Cancel the source in a try/finally (and cancel the reader in readerToIterator)
via a shared closeQuietly helper. Add regression tests for both decode branches
and a getEventV4 HTTP round-trip through undici MockAgent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fc2f47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production114312241368
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7893110748968

❌ Failed Tests

▲ Vercel Production (1 failed)

nuxt (1 failed):

  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nitro125027
❌ nuxt124127
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.043s (+6.1% 🔺)1.006s (~)0.963s101.00x
💻 LocalExpress0.045s (+9.7% 🔺)1.006s (~)0.961s101.04x
💻 LocalNext.js (Turbopack)0.051s (+5.6% 🔺)1.006s (~)0.955s101.17x
🐘 PostgresNext.js (Turbopack)0.054s (-6.2% 🟢)1.011s (~)0.957s101.25x
🐘 PostgresNitro0.065s (+3.3%)1.012s (~)0.947s101.50x
🐘 PostgresExpress0.094s (+53.0% 🔺)1.033s (+2.1%)0.939s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.364s (-8.4% 🟢)2.332s (-4.3%)1.968s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.090s (-0.9%)2.007s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.093s (~)2.007s (~)0.914s101.00x
💻 LocalNitro1.096s (+0.7%)2.007s (~)0.911s101.01x
🐘 PostgresNext.js (Turbopack)1.102s (~)2.011s (~)0.909s101.01x
🐘 PostgresNitro1.112s (+0.7%)2.009s (~)0.897s101.02x
🐘 PostgresExpress1.112s (+0.8%)2.010s (~)0.898s101.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.893s (+24.5% 🔺)3.512s (-1.6%)1.619s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.505s (~)11.012s (~)0.507s31.00x
💻 LocalNitro10.519s (~)11.023s (~)0.504s31.00x
💻 LocalExpress10.523s (~)11.024s (~)0.501s31.00x
🐘 PostgresNext.js (Turbopack)10.527s (~)11.021s (~)0.494s31.00x
💻 LocalNext.js (Turbopack)10.544s (~)11.023s (~)0.479s31.00x
🐘 PostgresNitro10.548s (~)11.018s (~)0.470s31.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express13.799s (+5.4% 🔺)15.362s (+1.0%)1.564s21.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.737s (~)14.018s (~)0.281s51.00x
💻 LocalExpress13.742s (-1.8%)14.027s (-1.4%)0.284s51.00x
💻 LocalNitro13.782s (+0.7%)14.028s (~)0.246s51.00x
🐘 PostgresNitro13.805s (-0.7%)14.018s (~)0.213s51.00x
🐘 PostgresNext.js (Turbopack)13.837s (-0.6%)14.023s (~)0.186s51.01x
💻 LocalNext.js (Turbopack)13.855s (+1.1%)14.028s (~)0.174s51.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express22.314s (+10.7% 🔺)23.407s (+4.4%)1.092s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)12.376s (-1.2%)13.016s (~)0.639s71.00x
💻 LocalExpress12.387s (-1.6%)13.025s (~)0.638s71.00x
🐘 PostgresNitro12.475s (+0.6%)13.022s (~)0.547s71.01x
💻 LocalNext.js (Turbopack)12.485s (~)13.025s (~)0.541s71.01x
💻 LocalNitro12.649s (+2.9%)13.027s (~)0.378s71.02x
🐘 PostgresExpress13.722s (+10.2% 🔺)14.042s (+7.9% 🔺)0.320s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.031s (+34.8% 🔺)33.465s (+33.0% 🔺)2.434s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (~)2.008s (~)0.854s151.00x
🐘 PostgresNitro1.193s (~)2.009s (~)0.816s151.03x
💻 LocalExpress1.223s (-0.6%)2.006s (~)0.783s151.06x
🐘 PostgresExpress1.236s (+3.4%)2.012s (~)0.776s151.07x
💻 LocalNitro1.238s (+2.9%)2.007s (~)0.769s151.07x
💻 LocalNext.js (Turbopack)1.294s (-5.9% 🟢)2.006s (~)0.712s151.12x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.811s (+4.4%)4.319s (-3.1%)1.508s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.264s (+1.0%)2.009s (~)0.744s151.00x
🐘 PostgresExpress1.271s (-2.8%)2.012s (-3.0%)0.741s151.01x
🐘 PostgresNitro1.276s (+0.5%)2.008s (~)0.732s151.01x
💻 LocalNitro2.000s (-0.8%)2.316s (-7.6% 🟢)0.316s131.58x
💻 LocalExpress2.152s (+5.7% 🔺)2.392s (-4.6%)0.241s131.70x
💻 LocalNext.js (Turbopack)2.297s (-2.0%)2.735s (-6.3% 🟢)0.438s111.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.236s (+14.1% 🔺)4.742s (+3.3%)1.506s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.486s (+2.5%)3.762s (+2.2%)2.276s81.00x
🐘 PostgresNext.js (Turbopack)1.516s (+2.3%)3.885s (~)2.369s81.02x
🐘 PostgresExpress1.617s (-2.4%)3.570s (-5.1% 🟢)1.953s91.09x
💻 LocalNitro5.496s (+22.6% 🔺)6.015s (+20.0% 🔺)0.519s53.70x
💻 LocalExpress5.652s (-2.1%)6.016s (-6.2% 🟢)0.364s53.80x
💻 LocalNext.js (Turbopack)6.781s (+1.4%)7.416s (~)0.635s54.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.669s (+117.1% 🔺)8.889s (+80.3% 🔺)2.220s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.144s (-2.5%)2.007s (~)0.864s151.00x
🐘 PostgresExpress1.188s (-0.6%)2.014s (~)0.826s151.04x
🐘 PostgresNitro1.203s (~)2.007s (~)0.804s151.05x
💻 LocalExpress1.204s (-2.1%)2.006s (~)0.802s151.05x
💻 LocalNitro1.231s (~)2.007s (~)0.776s151.08x
💻 LocalNext.js (Turbopack)1.393s (+3.1%)2.006s (~)0.614s151.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.013s (+48.9% 🔺)4.449s (+13.9% 🔺)1.436s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.257s (-0.5%)2.150s (+3.6%)0.893s141.00x
🐘 PostgresExpress1.263s (-2.5%)2.006s (~)0.744s151.00x
🐘 PostgresNitro1.292s (+1.3%)2.008s (~)0.716s151.03x
💻 LocalExpress1.988s (-2.4%)2.470s (-9.8% 🟢)0.482s131.58x
💻 LocalNitro1.997s (-0.6%)2.508s (+8.4% 🔺)0.511s121.59x
💻 LocalNext.js (Turbopack)2.250s (-7.0% 🟢)2.734s (-6.3% 🟢)0.485s111.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.587s (+39.0% 🔺)5.426s (+24.8% 🔺)1.839s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.446s (-0.7%)3.760s (~)2.314s81.00x
🐘 PostgresExpress1.451s (+1.4%)3.677s (-2.2%)2.226s91.00x
🐘 PostgresNext.js (Turbopack)1.477s (+0.5%)4.009s (+3.2%)2.532s81.02x
💻 LocalExpress5.477s (-8.2% 🟢)6.017s (-11.7% 🟢)0.540s53.79x
💻 LocalNitro5.878s (+18.9% 🔺)6.417s (+16.4% 🔺)0.539s54.07x
💻 LocalNext.js (Turbopack)6.700s (-1.3%)7.219s (-3.9%)0.519s54.63x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.783s (+35.9% 🔺)7.504s (+23.1% 🔺)1.721s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.518s (-8.3% 🟢)1.006s (-1.7%)0.488s601.00x
🐘 PostgresExpress0.525s (-8.8% 🟢)1.025s (~)0.500s591.01x
🐘 PostgresNitro0.551s (-2.0%)1.006s (-1.6%)0.456s601.06x
💻 LocalExpress0.572s (-6.3% 🟢)1.005s (~)0.433s601.10x
💻 LocalNext.js (Turbopack)0.585s (-4.4%)1.005s (-1.7%)0.420s601.13x
💻 LocalNitro0.604s (+5.9% 🔺)1.005s (-1.6%)0.401s601.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.117s (+20.0% 🔺)5.558s (+2.4%)1.441s111.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.258s (-1.4%)2.007s (~)0.749s451.00x
🐘 PostgresExpress1.304s (-1.6%)1.946s (-3.1%)0.641s471.04x
🐘 PostgresNitro1.310s (+2.8%)2.008s (~)0.698s451.04x
💻 LocalExpress1.493s (-4.2%)2.028s (~)0.535s451.19x
💻 LocalNext.js (Turbopack)1.506s (+2.1%)2.006s (~)0.500s451.20x
💻 LocalNitro1.506s (+8.9% 🔺)2.007s (~)0.500s451.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express10.059s (+17.3% 🔺)12.286s (+17.8% 🔺)2.227s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.356s (-10.6% 🟢)2.984s (-2.4%)0.628s411.00x
🐘 PostgresNext.js (Turbopack)2.527s (-0.9%)3.009s (~)0.482s401.07x
🐘 PostgresNitro2.608s (-1.7%)3.059s (-2.5%)0.451s401.11x
💻 LocalExpress3.231s (-0.6%)3.977s (-0.8%)0.746s311.37x
💻 LocalNext.js (Turbopack)3.258s (+1.7%)4.010s (+0.8%)0.751s301.38x
💻 LocalNitro3.296s (+10.0% 🔺)4.010s (+16.7% 🔺)0.714s301.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.195s (+27.6% 🔺)21.256s (+23.4% 🔺)2.061s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.167s (-6.5% 🟢)1.007s (~)0.840s601.00x
🐘 PostgresExpress0.200s (-8.5% 🟢)1.012s (+0.6%)0.812s601.20x
🐘 PostgresNitro0.229s (+8.3% 🔺)1.006s (~)0.777s601.37x
💻 LocalExpress0.345s (+1.0%)1.005s (~)0.660s602.06x
💻 LocalNitro0.358s (+6.0% 🔺)1.005s (~)0.647s602.14x
💻 LocalNext.js (Turbopack)0.633s (+4.6%)1.039s (+3.4%)0.406s583.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.608s (+27.1% 🔺)3.173s (+7.4% 🔺)1.565s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.271s (+1.1%)1.029s (+2.3%)0.758s881.00x
🐘 PostgresNitro0.345s (+6.7% 🔺)1.007s (~)0.662s901.27x
🐘 PostgresExpress0.514s (+60.2% 🔺)1.043s (+3.7%)0.529s871.90x
💻 LocalNitro2.066s (+2.0%)2.537s (+2.8%)0.471s367.62x
💻 LocalExpress2.070s (+5.8% 🔺)2.470s (~)0.400s377.64x
💻 LocalNext.js (Turbopack)2.643s (-0.9%)3.296s (+7.2% 🔺)0.652s289.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.327s (+37.2% 🔺)4.125s (+16.7% 🔺)1.798s231.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s (+0.8%)2.936s (-3.2%)2.451s411.00x
🐘 PostgresNitro0.516s (-1.7%)1.068s (+1.8%)0.553s1131.06x
🐘 PostgresExpress0.579s (+17.4% 🔺)1.120s (+10.4% 🔺)0.541s1081.19x
💻 LocalNitro9.822s (+5.0%)10.445s (+3.3%)0.622s1220.23x
💻 LocalExpress9.969s (+1.9%)10.695s (+0.8%)0.726s1220.53x
💻 LocalNext.js (Turbopack)11.201s (+11.3% 🔺)12.131s (+9.1% 🔺)0.929s1023.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.258s (+75.6% 🔺)6.218s (+42.1% 🔺)1.959s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (-1.3%)2.001s (~)0.001s (~)2.011s (~)0.856s101.00x
💻 LocalNext.js (Turbopack)1.157s (~)2.003s (~)0.012s (-3.2%)2.019s (~)0.862s101.00x
💻 LocalExpress1.169s (~)2.005s (~)0.012s (-4.1%)2.020s (~)0.851s101.01x
💻 LocalNitro1.171s (+1.8%)2.005s (~)0.013s (+37.0% 🔺)2.020s (~)0.850s101.01x
🐘 PostgresNitro1.176s (+0.6%)1.995s (~)0.001s (-31.6% 🟢)2.011s (~)0.835s101.02x
🐘 PostgresExpress1.269s (+7.7% 🔺)1.971s (-1.2%)0.001s (-42.9% 🟢)2.029s (+0.9%)0.760s101.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.523s (+11.7% 🔺)3.515s (+3.1%)2.599s (-4.0%)6.612s (-3.0%)4.090s101.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.576s (-0.5%)2.010s (~)0.012s (~)2.025s (~)0.449s301.00x
🐘 PostgresNext.js (Turbopack)1.595s (~)2.010s (~)0.005s (+10.1% 🔺)2.026s (~)0.430s301.01x
🐘 PostgresNitro1.599s (-2.6%)2.005s (-1.6%)0.005s (+1.3%)2.027s (-1.5%)0.428s301.01x
💻 LocalNitro1.611s (+2.0%)2.010s (~)0.012s (~)2.025s (~)0.415s301.02x
💻 LocalNext.js (Turbopack)1.645s (+1.7%)2.008s (~)0.013s (-1.6%)2.025s (~)0.380s301.04x
🐘 PostgresExpress1.722s (+8.6% 🔺)2.144s (+7.0% 🔺)0.004s (-15.1% 🟢)2.169s (+7.0% 🔺)0.447s281.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.853s (+11.7% 🔺)8.340s (+6.3% 🔺)0.224s (-21.0% 🟢)9.063s (+4.5%)2.210s71.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.793s (+3.1%)1.070s (-3.1%)0.000s (-1.8%)1.097s (-1.9%)0.304s551.00x
🐘 PostgresNext.js (Turbopack)0.810s (+6.4% 🔺)1.111s (+2.1%)0.000s (+111.1% 🔺)1.119s (+2.1%)0.309s541.02x
🐘 PostgresExpress1.124s (+47.2% 🔺)1.532s (+44.0% 🔺)0.000s (+Infinity% 🔺)1.560s (+44.6% 🔺)0.436s391.42x
💻 LocalExpress1.361s (+2.9%)2.013s (~)0.001s (+54.5% 🔺)2.016s (~)0.655s301.72x
💻 LocalNitro1.377s (+0.9%)2.014s (~)0.001s (+50.0% 🔺)2.017s (~)0.640s301.74x
💻 LocalNext.js (Turbopack)1.496s (+3.3%)2.013s (~)0.001s (+77.8% 🔺)2.017s (~)0.521s301.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.729s (+10.4% 🔺)4.651s (-7.8% 🟢)0.000s (-54.2% 🟢)5.149s (-7.5% 🟢)1.419s121.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.578s (-4.7%)2.257s (+1.9%)0.000s (-100.0% 🟢)2.289s (+2.6%)0.711s271.00x
🐘 PostgresNext.js (Turbopack)1.935s (+1.4%)2.544s (~)0.000s (+Infinity% 🔺)2.552s (~)0.617s241.23x
🐘 PostgresExpress2.497s (+63.3% 🔺)3.006s (+43.1% 🔺)0.000s (+33.3% 🔺)3.068s (+42.6% 🔺)0.571s211.58x
💻 LocalExpress3.453s (-5.2% 🟢)3.965s (-6.2% 🟢)0.000s (-43.7% 🟢)3.969s (-6.2% 🟢)0.517s162.19x
💻 LocalNitro3.647s (+4.2%)4.092s (+3.3%)0.000s (-64.4% 🟢)4.099s (+3.2%)0.452s152.31x
💻 LocalNext.js (Turbopack)3.962s (-3.8%)4.529s (-1.5%)0.000s (-72.2% 🟢)4.534s (-1.6%)0.572s142.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.001s (-27.3% 🟢)7.053s (-28.6% 🟢)0.000s (-100.0% 🟢)7.582s (-27.4% 🟢)1.581s81.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress14/21
🐘 PostgresNext.js (Turbopack)14/21
▲ VercelExpress21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres15/21
Next.js (Turbopack)🐘 Postgres19/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@vercel
vercelBot requested a deployment to Preview – workbench-express-workflow June 20, 2026 19:05 Abandoned
@smaeda-ks
smaeda-ks marked this pull request as ready for review June 20, 2026 19:12
@smaeda-ks
smaeda-ks requested a review from a team as a code ownerJune 20, 2026 19:12
@VaguelySerious
VaguelySerious merged commit e3672e8 into mainJun 20, 2026
113 of 119 checks passed
@VaguelySerious
VaguelySerious deleted the shohei/conn-leak branch June 20, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for e3672e8 (AI decision).

This fix targets the decodeFrames/readerToIterator machinery in packages/world-vercel/src/frames.ts (and tests in frames.test.ts / events-v4.test.ts), none of which exist on stable — verified that stable has no frames.ts, no events-v4.*, and an events.ts with no streaming/frame-decoding logic at all. The v4 frame-stream wire format is main-only, so the bug being fixed does not exist on stable and the change cannot apply there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

e3672e84f4996fbd35fc2542d11d401979d76924

pranaygp added a commit that referenced this pull request Jun 22, 2026
…testing
* origin/main:
Version Packages (beta) (#2540)
perf(core): memoize step return value hydration across inline replays (#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (#2412)
Amend lazy discovery removal changeset (#2560)
[docs] Document minimum SDK version for using hook.getConflict (#2423)
Update default CODEOWNERS (#2556)
Optimize and fix the default eager build mode (#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (#2547)" (#2554)
[core] Turbo mode: fast-path the first invocation (#2526)
Remove lazy discovery from workflow/next (#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (#2547)
feat(docs): add eve and AI SDK to product switcher (#2543)
[vitest] Fix local imports failing to load in test step bundles (#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (#2324)
Version Packages (beta) (#2495)
otel(world-vercel): inject trace context on v4 event requests (#2533)
Bump undici to 7.28.0 (#2534)
Default source maps to dev-on / prod-off (#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (#2527)
perf(core): parallel inline steps + optimistic lazy step start (#2516)
pranaygp added a commit to marcopiraccini/workflow that referenced this pull request Jun 22, 2026
* origin/main: (120 commits)
Version Packages (beta) (vercel#2540)
perf(core): memoize step return value hydration across inline replays (vercel#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (vercel#2412)
Amend lazy discovery removal changeset (vercel#2560)
[docs] Document minimum SDK version for using hook.getConflict (vercel#2423)
Update default CODEOWNERS (vercel#2556)
Optimize and fix the default eager build mode (vercel#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)" (vercel#2554)
[core] Turbo mode: fast-path the first invocation (vercel#2526)
Remove lazy discovery from workflow/next (vercel#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)
feat(docs): add eve and AI SDK to product switcher (vercel#2543)
[vitest] Fix local imports failing to load in test step bundles (vercel#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (vercel#2324)
Version Packages (beta) (vercel#2495)
otel(world-vercel): inject trace context on v4 event requests (vercel#2533)
Bump undici to 7.28.0 (vercel#2534)
Default source maps to dev-on / prod-off (vercel#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (vercel#2527)
perf(core): parallel inline steps + optimistic lazy step start (vercel#2516)
...
VaguelySerious added a commit that referenced this pull request Jul 10, 2026
The straight reapply of #2547 awaited chunks.return?.()/reader.cancel()
in decodeFrames' finally block, blocking every early-exit caller
(getEventV4, every replay's list read) on the cancel's completion. On
Vercel's Next.js (turbopack + webpack) Function lanes this hung
indefinitely — confirmed via CI: every single E2E Vercel Prod run got
stuck in "running" after its step completed, for the full 30-minute
window, while all other frameworks passed cleanly in ~15 minutes.
Same failure signature and same two CI lanes as #2807's awaited
reader.cancel() bug in the core abort-stream reader — very likely the
actual (undocumented) reason #2547 was reverted. Fix: fire-and-forget
the cancel, matching #2807's pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@smaeda-ks@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections by smaeda-ks · Pull Request #2547 · vercel/workflow · GitHub
Skip to content

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections - #2547

Merged
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak
Jun 20, 2026
Merged

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections#2547
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak

Conversation

@smaeda-ks

@smaeda-kssmaeda-ks commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

decodeFrames (the v4 event frame-stream reader) never cancelled its underlying response.body when a consumer stopped reading before EOF. With Node's fetch/undici, a response body that is neither fully drained nor cancelled keeps its socket checked out of the connection pool — so every such read leaks a connection until keepalive timeout/GC.

Two live read paths stop early by design and hit this:

CallerEarly exitFrequency
getEventV4returns after the first frame (single-frame response)per event read
consumeListFrameStream (getWorkflowRunEventsV4 / getEventsByCorrelationIdV4)breaks at the {_end:1} sentinelper event-list, i.e. ~every replay

This is the v4 wire format that events.ts uses "throughout" (it replaced the v2/v3 readers), so the leak is on the current, hot replay path — not legacy code.

Why it matters

In production every event read goes to a single origin — vercel-workflow.com (direct) or api.vercel.com (proxy) — and the dispatcher caps that origin at connections: 8 (HTTP/1.1). A leaked body holds its connection "in use," so it isn't returned to the pool. Pin ~8 of them and the pool is saturated: subsequent reads queue until a connection frees (the dropped response is GC-reclaimed, or the 60s request timeout fires). The user-visible result is intermittent stalls and timeouts on the event-read path; because each pinned connection ends up single-use instead of kept-alive, connection churn rises too.

Fix

packages/world-vercel/src/frames.ts:

  • Wrap the decodeFrames read loop in try/finally and call chunks.return?.() on exit, which cancels the source stream (releasing the socket) on early break/return, normal completion, and error paths alike. No-op once drained.
  • readerToIterator now cancels its reader in a finally (the non-async-iterable fallback branch).
  • Both share a small internal closeQuietly helper that swallows only cleanup errors, so it can't mask the original outcome.
  • Collapsed the redundant bodyLen > 0 / else branch into one path (slice(0, 0) already yields an empty body) — behavior identical.

Returned values are unaffected: frame.body is an owned slice copy, and the cancel runs after the result is assembled, so cancelling the remaining body can't corrupt what callers receive.

Test plan

  • packages/world-vercel/src/frames.test.ts: new tests asserting the underlying stream is cancelled when the consumer breaks early — for both the async-iterable branch and the getReader/readerToIterator branch — plus a guard that full consumption still decodes every frame. The spyStream helper models a kept-alive socket (highWaterMark: 0, never signals EOF); a toy stream that auto-closes would make cancel() a no-op and give a false pass.
  • packages/world-vercel/src/events-v4.test.ts: new getEventV4 HTTP round-trip via undici MockAgent (this path previously had no test). Includes a trailing frame the reader must never read, proving the early return + cancel returns correct data and doesn't hang.
  • Verified the new tests fail against pre-fix code and pass with the fix.
  • pnpm test (world-vercel): 167 passed. pnpm typecheck and biome check: clean.

Scope

Targets the decodeFrames early-exit leak only. A few lower-frequency error/edge paths (streamer.tsget()/list() throwing without draining; the content-type / missing-header throws in events-v4.ts) are the same class of issue and can be a follow-up.

🤖 Generated with Claude Code

decodeFrames never cancelled response.body when a consumer stopped reading
before EOF — getEventV4 returns after the first frame and consumeListFrameStream
breaks at the sentinel — so the undici connection stayed checked out of the pool
(8 per origin) instead of being released, causing stalls/timeouts on the
event-read path.
Cancel the source in a try/finally (and cancel the reader in readerToIterator)
via a shared closeQuietly helper. Add regression tests for both decode branches
and a getEventV4 HTTP round-trip through undici MockAgent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fc2f47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production114312241368
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7893110748968

❌ Failed Tests

▲ Vercel Production (1 failed)

nuxt (1 failed):

  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nitro125027
❌ nuxt124127
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.043s (+6.1% 🔺)1.006s (~)0.963s101.00x
💻 LocalExpress0.045s (+9.7% 🔺)1.006s (~)0.961s101.04x
💻 LocalNext.js (Turbopack)0.051s (+5.6% 🔺)1.006s (~)0.955s101.17x
🐘 PostgresNext.js (Turbopack)0.054s (-6.2% 🟢)1.011s (~)0.957s101.25x
🐘 PostgresNitro0.065s (+3.3%)1.012s (~)0.947s101.50x
🐘 PostgresExpress0.094s (+53.0% 🔺)1.033s (+2.1%)0.939s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.364s (-8.4% 🟢)2.332s (-4.3%)1.968s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.090s (-0.9%)2.007s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.093s (~)2.007s (~)0.914s101.00x
💻 LocalNitro1.096s (+0.7%)2.007s (~)0.911s101.01x
🐘 PostgresNext.js (Turbopack)1.102s (~)2.011s (~)0.909s101.01x
🐘 PostgresNitro1.112s (+0.7%)2.009s (~)0.897s101.02x
🐘 PostgresExpress1.112s (+0.8%)2.010s (~)0.898s101.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.893s (+24.5% 🔺)3.512s (-1.6%)1.619s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.505s (~)11.012s (~)0.507s31.00x
💻 LocalNitro10.519s (~)11.023s (~)0.504s31.00x
💻 LocalExpress10.523s (~)11.024s (~)0.501s31.00x
🐘 PostgresNext.js (Turbopack)10.527s (~)11.021s (~)0.494s31.00x
💻 LocalNext.js (Turbopack)10.544s (~)11.023s (~)0.479s31.00x
🐘 PostgresNitro10.548s (~)11.018s (~)0.470s31.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express13.799s (+5.4% 🔺)15.362s (+1.0%)1.564s21.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.737s (~)14.018s (~)0.281s51.00x
💻 LocalExpress13.742s (-1.8%)14.027s (-1.4%)0.284s51.00x
💻 LocalNitro13.782s (+0.7%)14.028s (~)0.246s51.00x
🐘 PostgresNitro13.805s (-0.7%)14.018s (~)0.213s51.00x
🐘 PostgresNext.js (Turbopack)13.837s (-0.6%)14.023s (~)0.186s51.01x
💻 LocalNext.js (Turbopack)13.855s (+1.1%)14.028s (~)0.174s51.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express22.314s (+10.7% 🔺)23.407s (+4.4%)1.092s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)12.376s (-1.2%)13.016s (~)0.639s71.00x
💻 LocalExpress12.387s (-1.6%)13.025s (~)0.638s71.00x
🐘 PostgresNitro12.475s (+0.6%)13.022s (~)0.547s71.01x
💻 LocalNext.js (Turbopack)12.485s (~)13.025s (~)0.541s71.01x
💻 LocalNitro12.649s (+2.9%)13.027s (~)0.378s71.02x
🐘 PostgresExpress13.722s (+10.2% 🔺)14.042s (+7.9% 🔺)0.320s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.031s (+34.8% 🔺)33.465s (+33.0% 🔺)2.434s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (~)2.008s (~)0.854s151.00x
🐘 PostgresNitro1.193s (~)2.009s (~)0.816s151.03x
💻 LocalExpress1.223s (-0.6%)2.006s (~)0.783s151.06x
🐘 PostgresExpress1.236s (+3.4%)2.012s (~)0.776s151.07x
💻 LocalNitro1.238s (+2.9%)2.007s (~)0.769s151.07x
💻 LocalNext.js (Turbopack)1.294s (-5.9% 🟢)2.006s (~)0.712s151.12x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.811s (+4.4%)4.319s (-3.1%)1.508s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.264s (+1.0%)2.009s (~)0.744s151.00x
🐘 PostgresExpress1.271s (-2.8%)2.012s (-3.0%)0.741s151.01x
🐘 PostgresNitro1.276s (+0.5%)2.008s (~)0.732s151.01x
💻 LocalNitro2.000s (-0.8%)2.316s (-7.6% 🟢)0.316s131.58x
💻 LocalExpress2.152s (+5.7% 🔺)2.392s (-4.6%)0.241s131.70x
💻 LocalNext.js (Turbopack)2.297s (-2.0%)2.735s (-6.3% 🟢)0.438s111.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.236s (+14.1% 🔺)4.742s (+3.3%)1.506s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.486s (+2.5%)3.762s (+2.2%)2.276s81.00x
🐘 PostgresNext.js (Turbopack)1.516s (+2.3%)3.885s (~)2.369s81.02x
🐘 PostgresExpress1.617s (-2.4%)3.570s (-5.1% 🟢)1.953s91.09x
💻 LocalNitro5.496s (+22.6% 🔺)6.015s (+20.0% 🔺)0.519s53.70x
💻 LocalExpress5.652s (-2.1%)6.016s (-6.2% 🟢)0.364s53.80x
💻 LocalNext.js (Turbopack)6.781s (+1.4%)7.416s (~)0.635s54.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.669s (+117.1% 🔺)8.889s (+80.3% 🔺)2.220s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.144s (-2.5%)2.007s (~)0.864s151.00x
🐘 PostgresExpress1.188s (-0.6%)2.014s (~)0.826s151.04x
🐘 PostgresNitro1.203s (~)2.007s (~)0.804s151.05x
💻 LocalExpress1.204s (-2.1%)2.006s (~)0.802s151.05x
💻 LocalNitro1.231s (~)2.007s (~)0.776s151.08x
💻 LocalNext.js (Turbopack)1.393s (+3.1%)2.006s (~)0.614s151.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.013s (+48.9% 🔺)4.449s (+13.9% 🔺)1.436s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.257s (-0.5%)2.150s (+3.6%)0.893s141.00x
🐘 PostgresExpress1.263s (-2.5%)2.006s (~)0.744s151.00x
🐘 PostgresNitro1.292s (+1.3%)2.008s (~)0.716s151.03x
💻 LocalExpress1.988s (-2.4%)2.470s (-9.8% 🟢)0.482s131.58x
💻 LocalNitro1.997s (-0.6%)2.508s (+8.4% 🔺)0.511s121.59x
💻 LocalNext.js (Turbopack)2.250s (-7.0% 🟢)2.734s (-6.3% 🟢)0.485s111.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.587s (+39.0% 🔺)5.426s (+24.8% 🔺)1.839s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.446s (-0.7%)3.760s (~)2.314s81.00x
🐘 PostgresExpress1.451s (+1.4%)3.677s (-2.2%)2.226s91.00x
🐘 PostgresNext.js (Turbopack)1.477s (+0.5%)4.009s (+3.2%)2.532s81.02x
💻 LocalExpress5.477s (-8.2% 🟢)6.017s (-11.7% 🟢)0.540s53.79x
💻 LocalNitro5.878s (+18.9% 🔺)6.417s (+16.4% 🔺)0.539s54.07x
💻 LocalNext.js (Turbopack)6.700s (-1.3%)7.219s (-3.9%)0.519s54.63x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.783s (+35.9% 🔺)7.504s (+23.1% 🔺)1.721s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.518s (-8.3% 🟢)1.006s (-1.7%)0.488s601.00x
🐘 PostgresExpress0.525s (-8.8% 🟢)1.025s (~)0.500s591.01x
🐘 PostgresNitro0.551s (-2.0%)1.006s (-1.6%)0.456s601.06x
💻 LocalExpress0.572s (-6.3% 🟢)1.005s (~)0.433s601.10x
💻 LocalNext.js (Turbopack)0.585s (-4.4%)1.005s (-1.7%)0.420s601.13x
💻 LocalNitro0.604s (+5.9% 🔺)1.005s (-1.6%)0.401s601.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.117s (+20.0% 🔺)5.558s (+2.4%)1.441s111.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.258s (-1.4%)2.007s (~)0.749s451.00x
🐘 PostgresExpress1.304s (-1.6%)1.946s (-3.1%)0.641s471.04x
🐘 PostgresNitro1.310s (+2.8%)2.008s (~)0.698s451.04x
💻 LocalExpress1.493s (-4.2%)2.028s (~)0.535s451.19x
💻 LocalNext.js (Turbopack)1.506s (+2.1%)2.006s (~)0.500s451.20x
💻 LocalNitro1.506s (+8.9% 🔺)2.007s (~)0.500s451.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express10.059s (+17.3% 🔺)12.286s (+17.8% 🔺)2.227s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.356s (-10.6% 🟢)2.984s (-2.4%)0.628s411.00x
🐘 PostgresNext.js (Turbopack)2.527s (-0.9%)3.009s (~)0.482s401.07x
🐘 PostgresNitro2.608s (-1.7%)3.059s (-2.5%)0.451s401.11x
💻 LocalExpress3.231s (-0.6%)3.977s (-0.8%)0.746s311.37x
💻 LocalNext.js (Turbopack)3.258s (+1.7%)4.010s (+0.8%)0.751s301.38x
💻 LocalNitro3.296s (+10.0% 🔺)4.010s (+16.7% 🔺)0.714s301.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.195s (+27.6% 🔺)21.256s (+23.4% 🔺)2.061s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.167s (-6.5% 🟢)1.007s (~)0.840s601.00x
🐘 PostgresExpress0.200s (-8.5% 🟢)1.012s (+0.6%)0.812s601.20x
🐘 PostgresNitro0.229s (+8.3% 🔺)1.006s (~)0.777s601.37x
💻 LocalExpress0.345s (+1.0%)1.005s (~)0.660s602.06x
💻 LocalNitro0.358s (+6.0% 🔺)1.005s (~)0.647s602.14x
💻 LocalNext.js (Turbopack)0.633s (+4.6%)1.039s (+3.4%)0.406s583.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.608s (+27.1% 🔺)3.173s (+7.4% 🔺)1.565s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.271s (+1.1%)1.029s (+2.3%)0.758s881.00x
🐘 PostgresNitro0.345s (+6.7% 🔺)1.007s (~)0.662s901.27x
🐘 PostgresExpress0.514s (+60.2% 🔺)1.043s (+3.7%)0.529s871.90x
💻 LocalNitro2.066s (+2.0%)2.537s (+2.8%)0.471s367.62x
💻 LocalExpress2.070s (+5.8% 🔺)2.470s (~)0.400s377.64x
💻 LocalNext.js (Turbopack)2.643s (-0.9%)3.296s (+7.2% 🔺)0.652s289.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.327s (+37.2% 🔺)4.125s (+16.7% 🔺)1.798s231.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s (+0.8%)2.936s (-3.2%)2.451s411.00x
🐘 PostgresNitro0.516s (-1.7%)1.068s (+1.8%)0.553s1131.06x
🐘 PostgresExpress0.579s (+17.4% 🔺)1.120s (+10.4% 🔺)0.541s1081.19x
💻 LocalNitro9.822s (+5.0%)10.445s (+3.3%)0.622s1220.23x
💻 LocalExpress9.969s (+1.9%)10.695s (+0.8%)0.726s1220.53x
💻 LocalNext.js (Turbopack)11.201s (+11.3% 🔺)12.131s (+9.1% 🔺)0.929s1023.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.258s (+75.6% 🔺)6.218s (+42.1% 🔺)1.959s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (-1.3%)2.001s (~)0.001s (~)2.011s (~)0.856s101.00x
💻 LocalNext.js (Turbopack)1.157s (~)2.003s (~)0.012s (-3.2%)2.019s (~)0.862s101.00x
💻 LocalExpress1.169s (~)2.005s (~)0.012s (-4.1%)2.020s (~)0.851s101.01x
💻 LocalNitro1.171s (+1.8%)2.005s (~)0.013s (+37.0% 🔺)2.020s (~)0.850s101.01x
🐘 PostgresNitro1.176s (+0.6%)1.995s (~)0.001s (-31.6% 🟢)2.011s (~)0.835s101.02x
🐘 PostgresExpress1.269s (+7.7% 🔺)1.971s (-1.2%)0.001s (-42.9% 🟢)2.029s (+0.9%)0.760s101.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.523s (+11.7% 🔺)3.515s (+3.1%)2.599s (-4.0%)6.612s (-3.0%)4.090s101.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.576s (-0.5%)2.010s (~)0.012s (~)2.025s (~)0.449s301.00x
🐘 PostgresNext.js (Turbopack)1.595s (~)2.010s (~)0.005s (+10.1% 🔺)2.026s (~)0.430s301.01x
🐘 PostgresNitro1.599s (-2.6%)2.005s (-1.6%)0.005s (+1.3%)2.027s (-1.5%)0.428s301.01x
💻 LocalNitro1.611s (+2.0%)2.010s (~)0.012s (~)2.025s (~)0.415s301.02x
💻 LocalNext.js (Turbopack)1.645s (+1.7%)2.008s (~)0.013s (-1.6%)2.025s (~)0.380s301.04x
🐘 PostgresExpress1.722s (+8.6% 🔺)2.144s (+7.0% 🔺)0.004s (-15.1% 🟢)2.169s (+7.0% 🔺)0.447s281.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.853s (+11.7% 🔺)8.340s (+6.3% 🔺)0.224s (-21.0% 🟢)9.063s (+4.5%)2.210s71.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.793s (+3.1%)1.070s (-3.1%)0.000s (-1.8%)1.097s (-1.9%)0.304s551.00x
🐘 PostgresNext.js (Turbopack)0.810s (+6.4% 🔺)1.111s (+2.1%)0.000s (+111.1% 🔺)1.119s (+2.1%)0.309s541.02x
🐘 PostgresExpress1.124s (+47.2% 🔺)1.532s (+44.0% 🔺)0.000s (+Infinity% 🔺)1.560s (+44.6% 🔺)0.436s391.42x
💻 LocalExpress1.361s (+2.9%)2.013s (~)0.001s (+54.5% 🔺)2.016s (~)0.655s301.72x
💻 LocalNitro1.377s (+0.9%)2.014s (~)0.001s (+50.0% 🔺)2.017s (~)0.640s301.74x
💻 LocalNext.js (Turbopack)1.496s (+3.3%)2.013s (~)0.001s (+77.8% 🔺)2.017s (~)0.521s301.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.729s (+10.4% 🔺)4.651s (-7.8% 🟢)0.000s (-54.2% 🟢)5.149s (-7.5% 🟢)1.419s121.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.578s (-4.7%)2.257s (+1.9%)0.000s (-100.0% 🟢)2.289s (+2.6%)0.711s271.00x
🐘 PostgresNext.js (Turbopack)1.935s (+1.4%)2.544s (~)0.000s (+Infinity% 🔺)2.552s (~)0.617s241.23x
🐘 PostgresExpress2.497s (+63.3% 🔺)3.006s (+43.1% 🔺)0.000s (+33.3% 🔺)3.068s (+42.6% 🔺)0.571s211.58x
💻 LocalExpress3.453s (-5.2% 🟢)3.965s (-6.2% 🟢)0.000s (-43.7% 🟢)3.969s (-6.2% 🟢)0.517s162.19x
💻 LocalNitro3.647s (+4.2%)4.092s (+3.3%)0.000s (-64.4% 🟢)4.099s (+3.2%)0.452s152.31x
💻 LocalNext.js (Turbopack)3.962s (-3.8%)4.529s (-1.5%)0.000s (-72.2% 🟢)4.534s (-1.6%)0.572s142.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.001s (-27.3% 🟢)7.053s (-28.6% 🟢)0.000s (-100.0% 🟢)7.582s (-27.4% 🟢)1.581s81.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress14/21
🐘 PostgresNext.js (Turbopack)14/21
▲ VercelExpress21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres15/21
Next.js (Turbopack)🐘 Postgres19/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@vercel
vercelBot requested a deployment to Preview – workbench-express-workflow June 20, 2026 19:05 Abandoned
@smaeda-ks
smaeda-ks marked this pull request as ready for review June 20, 2026 19:12
@smaeda-ks
smaeda-ks requested a review from a team as a code ownerJune 20, 2026 19:12
@VaguelySerious
VaguelySerious merged commit e3672e8 into mainJun 20, 2026
113 of 119 checks passed
@VaguelySerious
VaguelySerious deleted the shohei/conn-leak branch June 20, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for e3672e8 (AI decision).

This fix targets the decodeFrames/readerToIterator machinery in packages/world-vercel/src/frames.ts (and tests in frames.test.ts / events-v4.test.ts), none of which exist on stable — verified that stable has no frames.ts, no events-v4.*, and an events.ts with no streaming/frame-decoding logic at all. The v4 frame-stream wire format is main-only, so the bug being fixed does not exist on stable and the change cannot apply there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

e3672e84f4996fbd35fc2542d11d401979d76924

pranaygp added a commit that referenced this pull request Jun 22, 2026
…testing
* origin/main:
Version Packages (beta) (#2540)
perf(core): memoize step return value hydration across inline replays (#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (#2412)
Amend lazy discovery removal changeset (#2560)
[docs] Document minimum SDK version for using hook.getConflict (#2423)
Update default CODEOWNERS (#2556)
Optimize and fix the default eager build mode (#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (#2547)" (#2554)
[core] Turbo mode: fast-path the first invocation (#2526)
Remove lazy discovery from workflow/next (#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (#2547)
feat(docs): add eve and AI SDK to product switcher (#2543)
[vitest] Fix local imports failing to load in test step bundles (#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (#2324)
Version Packages (beta) (#2495)
otel(world-vercel): inject trace context on v4 event requests (#2533)
Bump undici to 7.28.0 (#2534)
Default source maps to dev-on / prod-off (#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (#2527)
perf(core): parallel inline steps + optimistic lazy step start (#2516)
pranaygp added a commit to marcopiraccini/workflow that referenced this pull request Jun 22, 2026
* origin/main: (120 commits)
Version Packages (beta) (vercel#2540)
perf(core): memoize step return value hydration across inline replays (vercel#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (vercel#2412)
Amend lazy discovery removal changeset (vercel#2560)
[docs] Document minimum SDK version for using hook.getConflict (vercel#2423)
Update default CODEOWNERS (vercel#2556)
Optimize and fix the default eager build mode (vercel#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)" (vercel#2554)
[core] Turbo mode: fast-path the first invocation (vercel#2526)
Remove lazy discovery from workflow/next (vercel#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)
feat(docs): add eve and AI SDK to product switcher (vercel#2543)
[vitest] Fix local imports failing to load in test step bundles (vercel#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (vercel#2324)
Version Packages (beta) (vercel#2495)
otel(world-vercel): inject trace context on v4 event requests (vercel#2533)
Bump undici to 7.28.0 (vercel#2534)
Default source maps to dev-on / prod-off (vercel#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (vercel#2527)
perf(core): parallel inline steps + optimistic lazy step start (vercel#2516)
...
VaguelySerious added a commit that referenced this pull request Jul 10, 2026
The straight reapply of #2547 awaited chunks.return?.()/reader.cancel()
in decodeFrames' finally block, blocking every early-exit caller
(getEventV4, every replay's list read) on the cancel's completion. On
Vercel's Next.js (turbopack + webpack) Function lanes this hung
indefinitely — confirmed via CI: every single E2E Vercel Prod run got
stuck in "running" after its step completed, for the full 30-minute
window, while all other frameworks passed cleanly in ~15 minutes.
Same failure signature and same two CI lanes as #2807's awaited
reader.cancel() bug in the core abort-stream reader — very likely the
actual (undocumented) reason #2547 was reverted. Fix: fire-and-forget
the cancel, matching #2807's pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@smaeda-ks@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections by smaeda-ks · Pull Request #2547 · vercel/workflow · GitHub
Skip to content

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections - #2547

Merged
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak
Jun 20, 2026
Merged

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections#2547
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak

Conversation

@smaeda-ks

@smaeda-kssmaeda-ks commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

decodeFrames (the v4 event frame-stream reader) never cancelled its underlying response.body when a consumer stopped reading before EOF. With Node's fetch/undici, a response body that is neither fully drained nor cancelled keeps its socket checked out of the connection pool — so every such read leaks a connection until keepalive timeout/GC.

Two live read paths stop early by design and hit this:

CallerEarly exitFrequency
getEventV4returns after the first frame (single-frame response)per event read
consumeListFrameStream (getWorkflowRunEventsV4 / getEventsByCorrelationIdV4)breaks at the {_end:1} sentinelper event-list, i.e. ~every replay

This is the v4 wire format that events.ts uses "throughout" (it replaced the v2/v3 readers), so the leak is on the current, hot replay path — not legacy code.

Why it matters

In production every event read goes to a single origin — vercel-workflow.com (direct) or api.vercel.com (proxy) — and the dispatcher caps that origin at connections: 8 (HTTP/1.1). A leaked body holds its connection "in use," so it isn't returned to the pool. Pin ~8 of them and the pool is saturated: subsequent reads queue until a connection frees (the dropped response is GC-reclaimed, or the 60s request timeout fires). The user-visible result is intermittent stalls and timeouts on the event-read path; because each pinned connection ends up single-use instead of kept-alive, connection churn rises too.

Fix

packages/world-vercel/src/frames.ts:

  • Wrap the decodeFrames read loop in try/finally and call chunks.return?.() on exit, which cancels the source stream (releasing the socket) on early break/return, normal completion, and error paths alike. No-op once drained.
  • readerToIterator now cancels its reader in a finally (the non-async-iterable fallback branch).
  • Both share a small internal closeQuietly helper that swallows only cleanup errors, so it can't mask the original outcome.
  • Collapsed the redundant bodyLen > 0 / else branch into one path (slice(0, 0) already yields an empty body) — behavior identical.

Returned values are unaffected: frame.body is an owned slice copy, and the cancel runs after the result is assembled, so cancelling the remaining body can't corrupt what callers receive.

Test plan

  • packages/world-vercel/src/frames.test.ts: new tests asserting the underlying stream is cancelled when the consumer breaks early — for both the async-iterable branch and the getReader/readerToIterator branch — plus a guard that full consumption still decodes every frame. The spyStream helper models a kept-alive socket (highWaterMark: 0, never signals EOF); a toy stream that auto-closes would make cancel() a no-op and give a false pass.
  • packages/world-vercel/src/events-v4.test.ts: new getEventV4 HTTP round-trip via undici MockAgent (this path previously had no test). Includes a trailing frame the reader must never read, proving the early return + cancel returns correct data and doesn't hang.
  • Verified the new tests fail against pre-fix code and pass with the fix.
  • pnpm test (world-vercel): 167 passed. pnpm typecheck and biome check: clean.

Scope

Targets the decodeFrames early-exit leak only. A few lower-frequency error/edge paths (streamer.tsget()/list() throwing without draining; the content-type / missing-header throws in events-v4.ts) are the same class of issue and can be a follow-up.

🤖 Generated with Claude Code

decodeFrames never cancelled response.body when a consumer stopped reading
before EOF — getEventV4 returns after the first frame and consumeListFrameStream
breaks at the sentinel — so the undici connection stayed checked out of the pool
(8 per origin) instead of being released, causing stalls/timeouts on the
event-read path.
Cancel the source in a try/finally (and cancel the reader in readerToIterator)
via a shared closeQuietly helper. Add regression tests for both decode branches
and a getEventV4 HTTP round-trip through undici MockAgent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fc2f47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production114312241368
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7893110748968

❌ Failed Tests

▲ Vercel Production (1 failed)

nuxt (1 failed):

  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nitro125027
❌ nuxt124127
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.043s (+6.1% 🔺)1.006s (~)0.963s101.00x
💻 LocalExpress0.045s (+9.7% 🔺)1.006s (~)0.961s101.04x
💻 LocalNext.js (Turbopack)0.051s (+5.6% 🔺)1.006s (~)0.955s101.17x
🐘 PostgresNext.js (Turbopack)0.054s (-6.2% 🟢)1.011s (~)0.957s101.25x
🐘 PostgresNitro0.065s (+3.3%)1.012s (~)0.947s101.50x
🐘 PostgresExpress0.094s (+53.0% 🔺)1.033s (+2.1%)0.939s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.364s (-8.4% 🟢)2.332s (-4.3%)1.968s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.090s (-0.9%)2.007s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.093s (~)2.007s (~)0.914s101.00x
💻 LocalNitro1.096s (+0.7%)2.007s (~)0.911s101.01x
🐘 PostgresNext.js (Turbopack)1.102s (~)2.011s (~)0.909s101.01x
🐘 PostgresNitro1.112s (+0.7%)2.009s (~)0.897s101.02x
🐘 PostgresExpress1.112s (+0.8%)2.010s (~)0.898s101.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.893s (+24.5% 🔺)3.512s (-1.6%)1.619s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.505s (~)11.012s (~)0.507s31.00x
💻 LocalNitro10.519s (~)11.023s (~)0.504s31.00x
💻 LocalExpress10.523s (~)11.024s (~)0.501s31.00x
🐘 PostgresNext.js (Turbopack)10.527s (~)11.021s (~)0.494s31.00x
💻 LocalNext.js (Turbopack)10.544s (~)11.023s (~)0.479s31.00x
🐘 PostgresNitro10.548s (~)11.018s (~)0.470s31.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express13.799s (+5.4% 🔺)15.362s (+1.0%)1.564s21.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.737s (~)14.018s (~)0.281s51.00x
💻 LocalExpress13.742s (-1.8%)14.027s (-1.4%)0.284s51.00x
💻 LocalNitro13.782s (+0.7%)14.028s (~)0.246s51.00x
🐘 PostgresNitro13.805s (-0.7%)14.018s (~)0.213s51.00x
🐘 PostgresNext.js (Turbopack)13.837s (-0.6%)14.023s (~)0.186s51.01x
💻 LocalNext.js (Turbopack)13.855s (+1.1%)14.028s (~)0.174s51.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express22.314s (+10.7% 🔺)23.407s (+4.4%)1.092s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)12.376s (-1.2%)13.016s (~)0.639s71.00x
💻 LocalExpress12.387s (-1.6%)13.025s (~)0.638s71.00x
🐘 PostgresNitro12.475s (+0.6%)13.022s (~)0.547s71.01x
💻 LocalNext.js (Turbopack)12.485s (~)13.025s (~)0.541s71.01x
💻 LocalNitro12.649s (+2.9%)13.027s (~)0.378s71.02x
🐘 PostgresExpress13.722s (+10.2% 🔺)14.042s (+7.9% 🔺)0.320s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.031s (+34.8% 🔺)33.465s (+33.0% 🔺)2.434s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (~)2.008s (~)0.854s151.00x
🐘 PostgresNitro1.193s (~)2.009s (~)0.816s151.03x
💻 LocalExpress1.223s (-0.6%)2.006s (~)0.783s151.06x
🐘 PostgresExpress1.236s (+3.4%)2.012s (~)0.776s151.07x
💻 LocalNitro1.238s (+2.9%)2.007s (~)0.769s151.07x
💻 LocalNext.js (Turbopack)1.294s (-5.9% 🟢)2.006s (~)0.712s151.12x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.811s (+4.4%)4.319s (-3.1%)1.508s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.264s (+1.0%)2.009s (~)0.744s151.00x
🐘 PostgresExpress1.271s (-2.8%)2.012s (-3.0%)0.741s151.01x
🐘 PostgresNitro1.276s (+0.5%)2.008s (~)0.732s151.01x
💻 LocalNitro2.000s (-0.8%)2.316s (-7.6% 🟢)0.316s131.58x
💻 LocalExpress2.152s (+5.7% 🔺)2.392s (-4.6%)0.241s131.70x
💻 LocalNext.js (Turbopack)2.297s (-2.0%)2.735s (-6.3% 🟢)0.438s111.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.236s (+14.1% 🔺)4.742s (+3.3%)1.506s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.486s (+2.5%)3.762s (+2.2%)2.276s81.00x
🐘 PostgresNext.js (Turbopack)1.516s (+2.3%)3.885s (~)2.369s81.02x
🐘 PostgresExpress1.617s (-2.4%)3.570s (-5.1% 🟢)1.953s91.09x
💻 LocalNitro5.496s (+22.6% 🔺)6.015s (+20.0% 🔺)0.519s53.70x
💻 LocalExpress5.652s (-2.1%)6.016s (-6.2% 🟢)0.364s53.80x
💻 LocalNext.js (Turbopack)6.781s (+1.4%)7.416s (~)0.635s54.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.669s (+117.1% 🔺)8.889s (+80.3% 🔺)2.220s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.144s (-2.5%)2.007s (~)0.864s151.00x
🐘 PostgresExpress1.188s (-0.6%)2.014s (~)0.826s151.04x
🐘 PostgresNitro1.203s (~)2.007s (~)0.804s151.05x
💻 LocalExpress1.204s (-2.1%)2.006s (~)0.802s151.05x
💻 LocalNitro1.231s (~)2.007s (~)0.776s151.08x
💻 LocalNext.js (Turbopack)1.393s (+3.1%)2.006s (~)0.614s151.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.013s (+48.9% 🔺)4.449s (+13.9% 🔺)1.436s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.257s (-0.5%)2.150s (+3.6%)0.893s141.00x
🐘 PostgresExpress1.263s (-2.5%)2.006s (~)0.744s151.00x
🐘 PostgresNitro1.292s (+1.3%)2.008s (~)0.716s151.03x
💻 LocalExpress1.988s (-2.4%)2.470s (-9.8% 🟢)0.482s131.58x
💻 LocalNitro1.997s (-0.6%)2.508s (+8.4% 🔺)0.511s121.59x
💻 LocalNext.js (Turbopack)2.250s (-7.0% 🟢)2.734s (-6.3% 🟢)0.485s111.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.587s (+39.0% 🔺)5.426s (+24.8% 🔺)1.839s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.446s (-0.7%)3.760s (~)2.314s81.00x
🐘 PostgresExpress1.451s (+1.4%)3.677s (-2.2%)2.226s91.00x
🐘 PostgresNext.js (Turbopack)1.477s (+0.5%)4.009s (+3.2%)2.532s81.02x
💻 LocalExpress5.477s (-8.2% 🟢)6.017s (-11.7% 🟢)0.540s53.79x
💻 LocalNitro5.878s (+18.9% 🔺)6.417s (+16.4% 🔺)0.539s54.07x
💻 LocalNext.js (Turbopack)6.700s (-1.3%)7.219s (-3.9%)0.519s54.63x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.783s (+35.9% 🔺)7.504s (+23.1% 🔺)1.721s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.518s (-8.3% 🟢)1.006s (-1.7%)0.488s601.00x
🐘 PostgresExpress0.525s (-8.8% 🟢)1.025s (~)0.500s591.01x
🐘 PostgresNitro0.551s (-2.0%)1.006s (-1.6%)0.456s601.06x
💻 LocalExpress0.572s (-6.3% 🟢)1.005s (~)0.433s601.10x
💻 LocalNext.js (Turbopack)0.585s (-4.4%)1.005s (-1.7%)0.420s601.13x
💻 LocalNitro0.604s (+5.9% 🔺)1.005s (-1.6%)0.401s601.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.117s (+20.0% 🔺)5.558s (+2.4%)1.441s111.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.258s (-1.4%)2.007s (~)0.749s451.00x
🐘 PostgresExpress1.304s (-1.6%)1.946s (-3.1%)0.641s471.04x
🐘 PostgresNitro1.310s (+2.8%)2.008s (~)0.698s451.04x
💻 LocalExpress1.493s (-4.2%)2.028s (~)0.535s451.19x
💻 LocalNext.js (Turbopack)1.506s (+2.1%)2.006s (~)0.500s451.20x
💻 LocalNitro1.506s (+8.9% 🔺)2.007s (~)0.500s451.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express10.059s (+17.3% 🔺)12.286s (+17.8% 🔺)2.227s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.356s (-10.6% 🟢)2.984s (-2.4%)0.628s411.00x
🐘 PostgresNext.js (Turbopack)2.527s (-0.9%)3.009s (~)0.482s401.07x
🐘 PostgresNitro2.608s (-1.7%)3.059s (-2.5%)0.451s401.11x
💻 LocalExpress3.231s (-0.6%)3.977s (-0.8%)0.746s311.37x
💻 LocalNext.js (Turbopack)3.258s (+1.7%)4.010s (+0.8%)0.751s301.38x
💻 LocalNitro3.296s (+10.0% 🔺)4.010s (+16.7% 🔺)0.714s301.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.195s (+27.6% 🔺)21.256s (+23.4% 🔺)2.061s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.167s (-6.5% 🟢)1.007s (~)0.840s601.00x
🐘 PostgresExpress0.200s (-8.5% 🟢)1.012s (+0.6%)0.812s601.20x
🐘 PostgresNitro0.229s (+8.3% 🔺)1.006s (~)0.777s601.37x
💻 LocalExpress0.345s (+1.0%)1.005s (~)0.660s602.06x
💻 LocalNitro0.358s (+6.0% 🔺)1.005s (~)0.647s602.14x
💻 LocalNext.js (Turbopack)0.633s (+4.6%)1.039s (+3.4%)0.406s583.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.608s (+27.1% 🔺)3.173s (+7.4% 🔺)1.565s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.271s (+1.1%)1.029s (+2.3%)0.758s881.00x
🐘 PostgresNitro0.345s (+6.7% 🔺)1.007s (~)0.662s901.27x
🐘 PostgresExpress0.514s (+60.2% 🔺)1.043s (+3.7%)0.529s871.90x
💻 LocalNitro2.066s (+2.0%)2.537s (+2.8%)0.471s367.62x
💻 LocalExpress2.070s (+5.8% 🔺)2.470s (~)0.400s377.64x
💻 LocalNext.js (Turbopack)2.643s (-0.9%)3.296s (+7.2% 🔺)0.652s289.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.327s (+37.2% 🔺)4.125s (+16.7% 🔺)1.798s231.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s (+0.8%)2.936s (-3.2%)2.451s411.00x
🐘 PostgresNitro0.516s (-1.7%)1.068s (+1.8%)0.553s1131.06x
🐘 PostgresExpress0.579s (+17.4% 🔺)1.120s (+10.4% 🔺)0.541s1081.19x
💻 LocalNitro9.822s (+5.0%)10.445s (+3.3%)0.622s1220.23x
💻 LocalExpress9.969s (+1.9%)10.695s (+0.8%)0.726s1220.53x
💻 LocalNext.js (Turbopack)11.201s (+11.3% 🔺)12.131s (+9.1% 🔺)0.929s1023.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.258s (+75.6% 🔺)6.218s (+42.1% 🔺)1.959s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (-1.3%)2.001s (~)0.001s (~)2.011s (~)0.856s101.00x
💻 LocalNext.js (Turbopack)1.157s (~)2.003s (~)0.012s (-3.2%)2.019s (~)0.862s101.00x
💻 LocalExpress1.169s (~)2.005s (~)0.012s (-4.1%)2.020s (~)0.851s101.01x
💻 LocalNitro1.171s (+1.8%)2.005s (~)0.013s (+37.0% 🔺)2.020s (~)0.850s101.01x
🐘 PostgresNitro1.176s (+0.6%)1.995s (~)0.001s (-31.6% 🟢)2.011s (~)0.835s101.02x
🐘 PostgresExpress1.269s (+7.7% 🔺)1.971s (-1.2%)0.001s (-42.9% 🟢)2.029s (+0.9%)0.760s101.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.523s (+11.7% 🔺)3.515s (+3.1%)2.599s (-4.0%)6.612s (-3.0%)4.090s101.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.576s (-0.5%)2.010s (~)0.012s (~)2.025s (~)0.449s301.00x
🐘 PostgresNext.js (Turbopack)1.595s (~)2.010s (~)0.005s (+10.1% 🔺)2.026s (~)0.430s301.01x
🐘 PostgresNitro1.599s (-2.6%)2.005s (-1.6%)0.005s (+1.3%)2.027s (-1.5%)0.428s301.01x
💻 LocalNitro1.611s (+2.0%)2.010s (~)0.012s (~)2.025s (~)0.415s301.02x
💻 LocalNext.js (Turbopack)1.645s (+1.7%)2.008s (~)0.013s (-1.6%)2.025s (~)0.380s301.04x
🐘 PostgresExpress1.722s (+8.6% 🔺)2.144s (+7.0% 🔺)0.004s (-15.1% 🟢)2.169s (+7.0% 🔺)0.447s281.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.853s (+11.7% 🔺)8.340s (+6.3% 🔺)0.224s (-21.0% 🟢)9.063s (+4.5%)2.210s71.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.793s (+3.1%)1.070s (-3.1%)0.000s (-1.8%)1.097s (-1.9%)0.304s551.00x
🐘 PostgresNext.js (Turbopack)0.810s (+6.4% 🔺)1.111s (+2.1%)0.000s (+111.1% 🔺)1.119s (+2.1%)0.309s541.02x
🐘 PostgresExpress1.124s (+47.2% 🔺)1.532s (+44.0% 🔺)0.000s (+Infinity% 🔺)1.560s (+44.6% 🔺)0.436s391.42x
💻 LocalExpress1.361s (+2.9%)2.013s (~)0.001s (+54.5% 🔺)2.016s (~)0.655s301.72x
💻 LocalNitro1.377s (+0.9%)2.014s (~)0.001s (+50.0% 🔺)2.017s (~)0.640s301.74x
💻 LocalNext.js (Turbopack)1.496s (+3.3%)2.013s (~)0.001s (+77.8% 🔺)2.017s (~)0.521s301.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.729s (+10.4% 🔺)4.651s (-7.8% 🟢)0.000s (-54.2% 🟢)5.149s (-7.5% 🟢)1.419s121.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.578s (-4.7%)2.257s (+1.9%)0.000s (-100.0% 🟢)2.289s (+2.6%)0.711s271.00x
🐘 PostgresNext.js (Turbopack)1.935s (+1.4%)2.544s (~)0.000s (+Infinity% 🔺)2.552s (~)0.617s241.23x
🐘 PostgresExpress2.497s (+63.3% 🔺)3.006s (+43.1% 🔺)0.000s (+33.3% 🔺)3.068s (+42.6% 🔺)0.571s211.58x
💻 LocalExpress3.453s (-5.2% 🟢)3.965s (-6.2% 🟢)0.000s (-43.7% 🟢)3.969s (-6.2% 🟢)0.517s162.19x
💻 LocalNitro3.647s (+4.2%)4.092s (+3.3%)0.000s (-64.4% 🟢)4.099s (+3.2%)0.452s152.31x
💻 LocalNext.js (Turbopack)3.962s (-3.8%)4.529s (-1.5%)0.000s (-72.2% 🟢)4.534s (-1.6%)0.572s142.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.001s (-27.3% 🟢)7.053s (-28.6% 🟢)0.000s (-100.0% 🟢)7.582s (-27.4% 🟢)1.581s81.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress14/21
🐘 PostgresNext.js (Turbopack)14/21
▲ VercelExpress21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres15/21
Next.js (Turbopack)🐘 Postgres19/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@vercel
vercelBot requested a deployment to Preview – workbench-express-workflow June 20, 2026 19:05 Abandoned
@smaeda-ks
smaeda-ks marked this pull request as ready for review June 20, 2026 19:12
@smaeda-ks
smaeda-ks requested a review from a team as a code ownerJune 20, 2026 19:12
@VaguelySerious
VaguelySerious merged commit e3672e8 into mainJun 20, 2026
113 of 119 checks passed
@VaguelySerious
VaguelySerious deleted the shohei/conn-leak branch June 20, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for e3672e8 (AI decision).

This fix targets the decodeFrames/readerToIterator machinery in packages/world-vercel/src/frames.ts (and tests in frames.test.ts / events-v4.test.ts), none of which exist on stable — verified that stable has no frames.ts, no events-v4.*, and an events.ts with no streaming/frame-decoding logic at all. The v4 frame-stream wire format is main-only, so the bug being fixed does not exist on stable and the change cannot apply there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

e3672e84f4996fbd35fc2542d11d401979d76924

pranaygp added a commit that referenced this pull request Jun 22, 2026
…testing
* origin/main:
Version Packages (beta) (#2540)
perf(core): memoize step return value hydration across inline replays (#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (#2412)
Amend lazy discovery removal changeset (#2560)
[docs] Document minimum SDK version for using hook.getConflict (#2423)
Update default CODEOWNERS (#2556)
Optimize and fix the default eager build mode (#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (#2547)" (#2554)
[core] Turbo mode: fast-path the first invocation (#2526)
Remove lazy discovery from workflow/next (#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (#2547)
feat(docs): add eve and AI SDK to product switcher (#2543)
[vitest] Fix local imports failing to load in test step bundles (#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (#2324)
Version Packages (beta) (#2495)
otel(world-vercel): inject trace context on v4 event requests (#2533)
Bump undici to 7.28.0 (#2534)
Default source maps to dev-on / prod-off (#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (#2527)
perf(core): parallel inline steps + optimistic lazy step start (#2516)
pranaygp added a commit to marcopiraccini/workflow that referenced this pull request Jun 22, 2026
* origin/main: (120 commits)
Version Packages (beta) (vercel#2540)
perf(core): memoize step return value hydration across inline replays (vercel#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (vercel#2412)
Amend lazy discovery removal changeset (vercel#2560)
[docs] Document minimum SDK version for using hook.getConflict (vercel#2423)
Update default CODEOWNERS (vercel#2556)
Optimize and fix the default eager build mode (vercel#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)" (vercel#2554)
[core] Turbo mode: fast-path the first invocation (vercel#2526)
Remove lazy discovery from workflow/next (vercel#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)
feat(docs): add eve and AI SDK to product switcher (vercel#2543)
[vitest] Fix local imports failing to load in test step bundles (vercel#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (vercel#2324)
Version Packages (beta) (vercel#2495)
otel(world-vercel): inject trace context on v4 event requests (vercel#2533)
Bump undici to 7.28.0 (vercel#2534)
Default source maps to dev-on / prod-off (vercel#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (vercel#2527)
perf(core): parallel inline steps + optimistic lazy step start (vercel#2516)
...
VaguelySerious added a commit that referenced this pull request Jul 10, 2026
The straight reapply of #2547 awaited chunks.return?.()/reader.cancel()
in decodeFrames' finally block, blocking every early-exit caller
(getEventV4, every replay's list read) on the cancel's completion. On
Vercel's Next.js (turbopack + webpack) Function lanes this hung
indefinitely — confirmed via CI: every single E2E Vercel Prod run got
stuck in "running" after its step completed, for the full 30-minute
window, while all other frameworks passed cleanly in ~15 minutes.
Same failure signature and same two CI lanes as #2807's awaited
reader.cancel() bug in the core abort-stream reader — very likely the
actual (undocumented) reason #2547 was reverted. Fix: fire-and-forget
the cancel, matching #2807's pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@smaeda-ks@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections by smaeda-ks · Pull Request #2547 · vercel/workflow · GitHub
Skip to content

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections - #2547

Merged
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak
Jun 20, 2026
Merged

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections#2547
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak

Conversation

@smaeda-ks

@smaeda-kssmaeda-ks commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

decodeFrames (the v4 event frame-stream reader) never cancelled its underlying response.body when a consumer stopped reading before EOF. With Node's fetch/undici, a response body that is neither fully drained nor cancelled keeps its socket checked out of the connection pool — so every such read leaks a connection until keepalive timeout/GC.

Two live read paths stop early by design and hit this:

CallerEarly exitFrequency
getEventV4returns after the first frame (single-frame response)per event read
consumeListFrameStream (getWorkflowRunEventsV4 / getEventsByCorrelationIdV4)breaks at the {_end:1} sentinelper event-list, i.e. ~every replay

This is the v4 wire format that events.ts uses "throughout" (it replaced the v2/v3 readers), so the leak is on the current, hot replay path — not legacy code.

Why it matters

In production every event read goes to a single origin — vercel-workflow.com (direct) or api.vercel.com (proxy) — and the dispatcher caps that origin at connections: 8 (HTTP/1.1). A leaked body holds its connection "in use," so it isn't returned to the pool. Pin ~8 of them and the pool is saturated: subsequent reads queue until a connection frees (the dropped response is GC-reclaimed, or the 60s request timeout fires). The user-visible result is intermittent stalls and timeouts on the event-read path; because each pinned connection ends up single-use instead of kept-alive, connection churn rises too.

Fix

packages/world-vercel/src/frames.ts:

  • Wrap the decodeFrames read loop in try/finally and call chunks.return?.() on exit, which cancels the source stream (releasing the socket) on early break/return, normal completion, and error paths alike. No-op once drained.
  • readerToIterator now cancels its reader in a finally (the non-async-iterable fallback branch).
  • Both share a small internal closeQuietly helper that swallows only cleanup errors, so it can't mask the original outcome.
  • Collapsed the redundant bodyLen > 0 / else branch into one path (slice(0, 0) already yields an empty body) — behavior identical.

Returned values are unaffected: frame.body is an owned slice copy, and the cancel runs after the result is assembled, so cancelling the remaining body can't corrupt what callers receive.

Test plan

  • packages/world-vercel/src/frames.test.ts: new tests asserting the underlying stream is cancelled when the consumer breaks early — for both the async-iterable branch and the getReader/readerToIterator branch — plus a guard that full consumption still decodes every frame. The spyStream helper models a kept-alive socket (highWaterMark: 0, never signals EOF); a toy stream that auto-closes would make cancel() a no-op and give a false pass.
  • packages/world-vercel/src/events-v4.test.ts: new getEventV4 HTTP round-trip via undici MockAgent (this path previously had no test). Includes a trailing frame the reader must never read, proving the early return + cancel returns correct data and doesn't hang.
  • Verified the new tests fail against pre-fix code and pass with the fix.
  • pnpm test (world-vercel): 167 passed. pnpm typecheck and biome check: clean.

Scope

Targets the decodeFrames early-exit leak only. A few lower-frequency error/edge paths (streamer.tsget()/list() throwing without draining; the content-type / missing-header throws in events-v4.ts) are the same class of issue and can be a follow-up.

🤖 Generated with Claude Code

decodeFrames never cancelled response.body when a consumer stopped reading
before EOF — getEventV4 returns after the first frame and consumeListFrameStream
breaks at the sentinel — so the undici connection stayed checked out of the pool
(8 per origin) instead of being released, causing stalls/timeouts on the
event-read path.
Cancel the source in a try/finally (and cancel the reader in readerToIterator)
via a shared closeQuietly helper. Add regression tests for both decode branches
and a getEventV4 HTTP round-trip through undici MockAgent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fc2f47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production114312241368
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7893110748968

❌ Failed Tests

▲ Vercel Production (1 failed)

nuxt (1 failed):

  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nitro125027
❌ nuxt124127
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.043s (+6.1% 🔺)1.006s (~)0.963s101.00x
💻 LocalExpress0.045s (+9.7% 🔺)1.006s (~)0.961s101.04x
💻 LocalNext.js (Turbopack)0.051s (+5.6% 🔺)1.006s (~)0.955s101.17x
🐘 PostgresNext.js (Turbopack)0.054s (-6.2% 🟢)1.011s (~)0.957s101.25x
🐘 PostgresNitro0.065s (+3.3%)1.012s (~)0.947s101.50x
🐘 PostgresExpress0.094s (+53.0% 🔺)1.033s (+2.1%)0.939s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.364s (-8.4% 🟢)2.332s (-4.3%)1.968s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.090s (-0.9%)2.007s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.093s (~)2.007s (~)0.914s101.00x
💻 LocalNitro1.096s (+0.7%)2.007s (~)0.911s101.01x
🐘 PostgresNext.js (Turbopack)1.102s (~)2.011s (~)0.909s101.01x
🐘 PostgresNitro1.112s (+0.7%)2.009s (~)0.897s101.02x
🐘 PostgresExpress1.112s (+0.8%)2.010s (~)0.898s101.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.893s (+24.5% 🔺)3.512s (-1.6%)1.619s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.505s (~)11.012s (~)0.507s31.00x
💻 LocalNitro10.519s (~)11.023s (~)0.504s31.00x
💻 LocalExpress10.523s (~)11.024s (~)0.501s31.00x
🐘 PostgresNext.js (Turbopack)10.527s (~)11.021s (~)0.494s31.00x
💻 LocalNext.js (Turbopack)10.544s (~)11.023s (~)0.479s31.00x
🐘 PostgresNitro10.548s (~)11.018s (~)0.470s31.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express13.799s (+5.4% 🔺)15.362s (+1.0%)1.564s21.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.737s (~)14.018s (~)0.281s51.00x
💻 LocalExpress13.742s (-1.8%)14.027s (-1.4%)0.284s51.00x
💻 LocalNitro13.782s (+0.7%)14.028s (~)0.246s51.00x
🐘 PostgresNitro13.805s (-0.7%)14.018s (~)0.213s51.00x
🐘 PostgresNext.js (Turbopack)13.837s (-0.6%)14.023s (~)0.186s51.01x
💻 LocalNext.js (Turbopack)13.855s (+1.1%)14.028s (~)0.174s51.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express22.314s (+10.7% 🔺)23.407s (+4.4%)1.092s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)12.376s (-1.2%)13.016s (~)0.639s71.00x
💻 LocalExpress12.387s (-1.6%)13.025s (~)0.638s71.00x
🐘 PostgresNitro12.475s (+0.6%)13.022s (~)0.547s71.01x
💻 LocalNext.js (Turbopack)12.485s (~)13.025s (~)0.541s71.01x
💻 LocalNitro12.649s (+2.9%)13.027s (~)0.378s71.02x
🐘 PostgresExpress13.722s (+10.2% 🔺)14.042s (+7.9% 🔺)0.320s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.031s (+34.8% 🔺)33.465s (+33.0% 🔺)2.434s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (~)2.008s (~)0.854s151.00x
🐘 PostgresNitro1.193s (~)2.009s (~)0.816s151.03x
💻 LocalExpress1.223s (-0.6%)2.006s (~)0.783s151.06x
🐘 PostgresExpress1.236s (+3.4%)2.012s (~)0.776s151.07x
💻 LocalNitro1.238s (+2.9%)2.007s (~)0.769s151.07x
💻 LocalNext.js (Turbopack)1.294s (-5.9% 🟢)2.006s (~)0.712s151.12x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.811s (+4.4%)4.319s (-3.1%)1.508s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.264s (+1.0%)2.009s (~)0.744s151.00x
🐘 PostgresExpress1.271s (-2.8%)2.012s (-3.0%)0.741s151.01x
🐘 PostgresNitro1.276s (+0.5%)2.008s (~)0.732s151.01x
💻 LocalNitro2.000s (-0.8%)2.316s (-7.6% 🟢)0.316s131.58x
💻 LocalExpress2.152s (+5.7% 🔺)2.392s (-4.6%)0.241s131.70x
💻 LocalNext.js (Turbopack)2.297s (-2.0%)2.735s (-6.3% 🟢)0.438s111.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.236s (+14.1% 🔺)4.742s (+3.3%)1.506s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.486s (+2.5%)3.762s (+2.2%)2.276s81.00x
🐘 PostgresNext.js (Turbopack)1.516s (+2.3%)3.885s (~)2.369s81.02x
🐘 PostgresExpress1.617s (-2.4%)3.570s (-5.1% 🟢)1.953s91.09x
💻 LocalNitro5.496s (+22.6% 🔺)6.015s (+20.0% 🔺)0.519s53.70x
💻 LocalExpress5.652s (-2.1%)6.016s (-6.2% 🟢)0.364s53.80x
💻 LocalNext.js (Turbopack)6.781s (+1.4%)7.416s (~)0.635s54.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.669s (+117.1% 🔺)8.889s (+80.3% 🔺)2.220s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.144s (-2.5%)2.007s (~)0.864s151.00x
🐘 PostgresExpress1.188s (-0.6%)2.014s (~)0.826s151.04x
🐘 PostgresNitro1.203s (~)2.007s (~)0.804s151.05x
💻 LocalExpress1.204s (-2.1%)2.006s (~)0.802s151.05x
💻 LocalNitro1.231s (~)2.007s (~)0.776s151.08x
💻 LocalNext.js (Turbopack)1.393s (+3.1%)2.006s (~)0.614s151.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.013s (+48.9% 🔺)4.449s (+13.9% 🔺)1.436s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.257s (-0.5%)2.150s (+3.6%)0.893s141.00x
🐘 PostgresExpress1.263s (-2.5%)2.006s (~)0.744s151.00x
🐘 PostgresNitro1.292s (+1.3%)2.008s (~)0.716s151.03x
💻 LocalExpress1.988s (-2.4%)2.470s (-9.8% 🟢)0.482s131.58x
💻 LocalNitro1.997s (-0.6%)2.508s (+8.4% 🔺)0.511s121.59x
💻 LocalNext.js (Turbopack)2.250s (-7.0% 🟢)2.734s (-6.3% 🟢)0.485s111.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.587s (+39.0% 🔺)5.426s (+24.8% 🔺)1.839s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.446s (-0.7%)3.760s (~)2.314s81.00x
🐘 PostgresExpress1.451s (+1.4%)3.677s (-2.2%)2.226s91.00x
🐘 PostgresNext.js (Turbopack)1.477s (+0.5%)4.009s (+3.2%)2.532s81.02x
💻 LocalExpress5.477s (-8.2% 🟢)6.017s (-11.7% 🟢)0.540s53.79x
💻 LocalNitro5.878s (+18.9% 🔺)6.417s (+16.4% 🔺)0.539s54.07x
💻 LocalNext.js (Turbopack)6.700s (-1.3%)7.219s (-3.9%)0.519s54.63x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.783s (+35.9% 🔺)7.504s (+23.1% 🔺)1.721s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.518s (-8.3% 🟢)1.006s (-1.7%)0.488s601.00x
🐘 PostgresExpress0.525s (-8.8% 🟢)1.025s (~)0.500s591.01x
🐘 PostgresNitro0.551s (-2.0%)1.006s (-1.6%)0.456s601.06x
💻 LocalExpress0.572s (-6.3% 🟢)1.005s (~)0.433s601.10x
💻 LocalNext.js (Turbopack)0.585s (-4.4%)1.005s (-1.7%)0.420s601.13x
💻 LocalNitro0.604s (+5.9% 🔺)1.005s (-1.6%)0.401s601.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.117s (+20.0% 🔺)5.558s (+2.4%)1.441s111.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.258s (-1.4%)2.007s (~)0.749s451.00x
🐘 PostgresExpress1.304s (-1.6%)1.946s (-3.1%)0.641s471.04x
🐘 PostgresNitro1.310s (+2.8%)2.008s (~)0.698s451.04x
💻 LocalExpress1.493s (-4.2%)2.028s (~)0.535s451.19x
💻 LocalNext.js (Turbopack)1.506s (+2.1%)2.006s (~)0.500s451.20x
💻 LocalNitro1.506s (+8.9% 🔺)2.007s (~)0.500s451.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express10.059s (+17.3% 🔺)12.286s (+17.8% 🔺)2.227s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.356s (-10.6% 🟢)2.984s (-2.4%)0.628s411.00x
🐘 PostgresNext.js (Turbopack)2.527s (-0.9%)3.009s (~)0.482s401.07x
🐘 PostgresNitro2.608s (-1.7%)3.059s (-2.5%)0.451s401.11x
💻 LocalExpress3.231s (-0.6%)3.977s (-0.8%)0.746s311.37x
💻 LocalNext.js (Turbopack)3.258s (+1.7%)4.010s (+0.8%)0.751s301.38x
💻 LocalNitro3.296s (+10.0% 🔺)4.010s (+16.7% 🔺)0.714s301.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.195s (+27.6% 🔺)21.256s (+23.4% 🔺)2.061s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.167s (-6.5% 🟢)1.007s (~)0.840s601.00x
🐘 PostgresExpress0.200s (-8.5% 🟢)1.012s (+0.6%)0.812s601.20x
🐘 PostgresNitro0.229s (+8.3% 🔺)1.006s (~)0.777s601.37x
💻 LocalExpress0.345s (+1.0%)1.005s (~)0.660s602.06x
💻 LocalNitro0.358s (+6.0% 🔺)1.005s (~)0.647s602.14x
💻 LocalNext.js (Turbopack)0.633s (+4.6%)1.039s (+3.4%)0.406s583.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.608s (+27.1% 🔺)3.173s (+7.4% 🔺)1.565s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.271s (+1.1%)1.029s (+2.3%)0.758s881.00x
🐘 PostgresNitro0.345s (+6.7% 🔺)1.007s (~)0.662s901.27x
🐘 PostgresExpress0.514s (+60.2% 🔺)1.043s (+3.7%)0.529s871.90x
💻 LocalNitro2.066s (+2.0%)2.537s (+2.8%)0.471s367.62x
💻 LocalExpress2.070s (+5.8% 🔺)2.470s (~)0.400s377.64x
💻 LocalNext.js (Turbopack)2.643s (-0.9%)3.296s (+7.2% 🔺)0.652s289.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.327s (+37.2% 🔺)4.125s (+16.7% 🔺)1.798s231.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s (+0.8%)2.936s (-3.2%)2.451s411.00x
🐘 PostgresNitro0.516s (-1.7%)1.068s (+1.8%)0.553s1131.06x
🐘 PostgresExpress0.579s (+17.4% 🔺)1.120s (+10.4% 🔺)0.541s1081.19x
💻 LocalNitro9.822s (+5.0%)10.445s (+3.3%)0.622s1220.23x
💻 LocalExpress9.969s (+1.9%)10.695s (+0.8%)0.726s1220.53x
💻 LocalNext.js (Turbopack)11.201s (+11.3% 🔺)12.131s (+9.1% 🔺)0.929s1023.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.258s (+75.6% 🔺)6.218s (+42.1% 🔺)1.959s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (-1.3%)2.001s (~)0.001s (~)2.011s (~)0.856s101.00x
💻 LocalNext.js (Turbopack)1.157s (~)2.003s (~)0.012s (-3.2%)2.019s (~)0.862s101.00x
💻 LocalExpress1.169s (~)2.005s (~)0.012s (-4.1%)2.020s (~)0.851s101.01x
💻 LocalNitro1.171s (+1.8%)2.005s (~)0.013s (+37.0% 🔺)2.020s (~)0.850s101.01x
🐘 PostgresNitro1.176s (+0.6%)1.995s (~)0.001s (-31.6% 🟢)2.011s (~)0.835s101.02x
🐘 PostgresExpress1.269s (+7.7% 🔺)1.971s (-1.2%)0.001s (-42.9% 🟢)2.029s (+0.9%)0.760s101.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.523s (+11.7% 🔺)3.515s (+3.1%)2.599s (-4.0%)6.612s (-3.0%)4.090s101.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.576s (-0.5%)2.010s (~)0.012s (~)2.025s (~)0.449s301.00x
🐘 PostgresNext.js (Turbopack)1.595s (~)2.010s (~)0.005s (+10.1% 🔺)2.026s (~)0.430s301.01x
🐘 PostgresNitro1.599s (-2.6%)2.005s (-1.6%)0.005s (+1.3%)2.027s (-1.5%)0.428s301.01x
💻 LocalNitro1.611s (+2.0%)2.010s (~)0.012s (~)2.025s (~)0.415s301.02x
💻 LocalNext.js (Turbopack)1.645s (+1.7%)2.008s (~)0.013s (-1.6%)2.025s (~)0.380s301.04x
🐘 PostgresExpress1.722s (+8.6% 🔺)2.144s (+7.0% 🔺)0.004s (-15.1% 🟢)2.169s (+7.0% 🔺)0.447s281.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.853s (+11.7% 🔺)8.340s (+6.3% 🔺)0.224s (-21.0% 🟢)9.063s (+4.5%)2.210s71.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.793s (+3.1%)1.070s (-3.1%)0.000s (-1.8%)1.097s (-1.9%)0.304s551.00x
🐘 PostgresNext.js (Turbopack)0.810s (+6.4% 🔺)1.111s (+2.1%)0.000s (+111.1% 🔺)1.119s (+2.1%)0.309s541.02x
🐘 PostgresExpress1.124s (+47.2% 🔺)1.532s (+44.0% 🔺)0.000s (+Infinity% 🔺)1.560s (+44.6% 🔺)0.436s391.42x
💻 LocalExpress1.361s (+2.9%)2.013s (~)0.001s (+54.5% 🔺)2.016s (~)0.655s301.72x
💻 LocalNitro1.377s (+0.9%)2.014s (~)0.001s (+50.0% 🔺)2.017s (~)0.640s301.74x
💻 LocalNext.js (Turbopack)1.496s (+3.3%)2.013s (~)0.001s (+77.8% 🔺)2.017s (~)0.521s301.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.729s (+10.4% 🔺)4.651s (-7.8% 🟢)0.000s (-54.2% 🟢)5.149s (-7.5% 🟢)1.419s121.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.578s (-4.7%)2.257s (+1.9%)0.000s (-100.0% 🟢)2.289s (+2.6%)0.711s271.00x
🐘 PostgresNext.js (Turbopack)1.935s (+1.4%)2.544s (~)0.000s (+Infinity% 🔺)2.552s (~)0.617s241.23x
🐘 PostgresExpress2.497s (+63.3% 🔺)3.006s (+43.1% 🔺)0.000s (+33.3% 🔺)3.068s (+42.6% 🔺)0.571s211.58x
💻 LocalExpress3.453s (-5.2% 🟢)3.965s (-6.2% 🟢)0.000s (-43.7% 🟢)3.969s (-6.2% 🟢)0.517s162.19x
💻 LocalNitro3.647s (+4.2%)4.092s (+3.3%)0.000s (-64.4% 🟢)4.099s (+3.2%)0.452s152.31x
💻 LocalNext.js (Turbopack)3.962s (-3.8%)4.529s (-1.5%)0.000s (-72.2% 🟢)4.534s (-1.6%)0.572s142.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.001s (-27.3% 🟢)7.053s (-28.6% 🟢)0.000s (-100.0% 🟢)7.582s (-27.4% 🟢)1.581s81.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress14/21
🐘 PostgresNext.js (Turbopack)14/21
▲ VercelExpress21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres15/21
Next.js (Turbopack)🐘 Postgres19/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@vercel
vercelBot requested a deployment to Preview – workbench-express-workflow June 20, 2026 19:05 Abandoned
@smaeda-ks
smaeda-ks marked this pull request as ready for review June 20, 2026 19:12
@smaeda-ks
smaeda-ks requested a review from a team as a code ownerJune 20, 2026 19:12
@VaguelySerious
VaguelySerious merged commit e3672e8 into mainJun 20, 2026
113 of 119 checks passed
@VaguelySerious
VaguelySerious deleted the shohei/conn-leak branch June 20, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for e3672e8 (AI decision).

This fix targets the decodeFrames/readerToIterator machinery in packages/world-vercel/src/frames.ts (and tests in frames.test.ts / events-v4.test.ts), none of which exist on stable — verified that stable has no frames.ts, no events-v4.*, and an events.ts with no streaming/frame-decoding logic at all. The v4 frame-stream wire format is main-only, so the bug being fixed does not exist on stable and the change cannot apply there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

e3672e84f4996fbd35fc2542d11d401979d76924

pranaygp added a commit that referenced this pull request Jun 22, 2026
…testing
* origin/main:
Version Packages (beta) (#2540)
perf(core): memoize step return value hydration across inline replays (#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (#2412)
Amend lazy discovery removal changeset (#2560)
[docs] Document minimum SDK version for using hook.getConflict (#2423)
Update default CODEOWNERS (#2556)
Optimize and fix the default eager build mode (#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (#2547)" (#2554)
[core] Turbo mode: fast-path the first invocation (#2526)
Remove lazy discovery from workflow/next (#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (#2547)
feat(docs): add eve and AI SDK to product switcher (#2543)
[vitest] Fix local imports failing to load in test step bundles (#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (#2324)
Version Packages (beta) (#2495)
otel(world-vercel): inject trace context on v4 event requests (#2533)
Bump undici to 7.28.0 (#2534)
Default source maps to dev-on / prod-off (#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (#2527)
perf(core): parallel inline steps + optimistic lazy step start (#2516)
pranaygp added a commit to marcopiraccini/workflow that referenced this pull request Jun 22, 2026
* origin/main: (120 commits)
Version Packages (beta) (vercel#2540)
perf(core): memoize step return value hydration across inline replays (vercel#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (vercel#2412)
Amend lazy discovery removal changeset (vercel#2560)
[docs] Document minimum SDK version for using hook.getConflict (vercel#2423)
Update default CODEOWNERS (vercel#2556)
Optimize and fix the default eager build mode (vercel#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)" (vercel#2554)
[core] Turbo mode: fast-path the first invocation (vercel#2526)
Remove lazy discovery from workflow/next (vercel#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)
feat(docs): add eve and AI SDK to product switcher (vercel#2543)
[vitest] Fix local imports failing to load in test step bundles (vercel#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (vercel#2324)
Version Packages (beta) (vercel#2495)
otel(world-vercel): inject trace context on v4 event requests (vercel#2533)
Bump undici to 7.28.0 (vercel#2534)
Default source maps to dev-on / prod-off (vercel#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (vercel#2527)
perf(core): parallel inline steps + optimistic lazy step start (vercel#2516)
...
VaguelySerious added a commit that referenced this pull request Jul 10, 2026
The straight reapply of #2547 awaited chunks.return?.()/reader.cancel()
in decodeFrames' finally block, blocking every early-exit caller
(getEventV4, every replay's list read) on the cancel's completion. On
Vercel's Next.js (turbopack + webpack) Function lanes this hung
indefinitely — confirmed via CI: every single E2E Vercel Prod run got
stuck in "running" after its step completed, for the full 30-minute
window, while all other frameworks passed cleanly in ~15 minutes.
Same failure signature and same two CI lanes as #2807's awaited
reader.cancel() bug in the core abort-stream reader — very likely the
actual (undocumented) reason #2547 was reverted. Fix: fire-and-forget
the cancel, matching #2807's pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@smaeda-ks@VaguelySerious
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections by smaeda-ks · Pull Request #2547 · vercel/workflow · GitHub
Skip to content

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections - #2547

Merged
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak
Jun 20, 2026
Merged

fix(world-vercel): cancel v4 event frame stream on early exit to release undici connections#2547
VaguelySerious merged 1 commit into
mainfrom
shohei/conn-leak

Conversation

@smaeda-ks

@smaeda-kssmaeda-ks commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

decodeFrames (the v4 event frame-stream reader) never cancelled its underlying response.body when a consumer stopped reading before EOF. With Node's fetch/undici, a response body that is neither fully drained nor cancelled keeps its socket checked out of the connection pool — so every such read leaks a connection until keepalive timeout/GC.

Two live read paths stop early by design and hit this:

CallerEarly exitFrequency
getEventV4returns after the first frame (single-frame response)per event read
consumeListFrameStream (getWorkflowRunEventsV4 / getEventsByCorrelationIdV4)breaks at the {_end:1} sentinelper event-list, i.e. ~every replay

This is the v4 wire format that events.ts uses "throughout" (it replaced the v2/v3 readers), so the leak is on the current, hot replay path — not legacy code.

Why it matters

In production every event read goes to a single origin — vercel-workflow.com (direct) or api.vercel.com (proxy) — and the dispatcher caps that origin at connections: 8 (HTTP/1.1). A leaked body holds its connection "in use," so it isn't returned to the pool. Pin ~8 of them and the pool is saturated: subsequent reads queue until a connection frees (the dropped response is GC-reclaimed, or the 60s request timeout fires). The user-visible result is intermittent stalls and timeouts on the event-read path; because each pinned connection ends up single-use instead of kept-alive, connection churn rises too.

Fix

packages/world-vercel/src/frames.ts:

  • Wrap the decodeFrames read loop in try/finally and call chunks.return?.() on exit, which cancels the source stream (releasing the socket) on early break/return, normal completion, and error paths alike. No-op once drained.
  • readerToIterator now cancels its reader in a finally (the non-async-iterable fallback branch).
  • Both share a small internal closeQuietly helper that swallows only cleanup errors, so it can't mask the original outcome.
  • Collapsed the redundant bodyLen > 0 / else branch into one path (slice(0, 0) already yields an empty body) — behavior identical.

Returned values are unaffected: frame.body is an owned slice copy, and the cancel runs after the result is assembled, so cancelling the remaining body can't corrupt what callers receive.

Test plan

  • packages/world-vercel/src/frames.test.ts: new tests asserting the underlying stream is cancelled when the consumer breaks early — for both the async-iterable branch and the getReader/readerToIterator branch — plus a guard that full consumption still decodes every frame. The spyStream helper models a kept-alive socket (highWaterMark: 0, never signals EOF); a toy stream that auto-closes would make cancel() a no-op and give a false pass.
  • packages/world-vercel/src/events-v4.test.ts: new getEventV4 HTTP round-trip via undici MockAgent (this path previously had no test). Includes a trailing frame the reader must never read, proving the early return + cancel returns correct data and doesn't hang.
  • Verified the new tests fail against pre-fix code and pass with the fix.
  • pnpm test (world-vercel): 167 passed. pnpm typecheck and biome check: clean.

Scope

Targets the decodeFrames early-exit leak only. A few lower-frequency error/edge paths (streamer.tsget()/list() throwing without draining; the content-type / missing-header throws in events-v4.ts) are the same class of issue and can be a follow-up.

🤖 Generated with Claude Code

decodeFrames never cancelled response.body when a consumer stopped reading
before EOF — getEventV4 returns after the first frame and consumeListFrameStream
breaks at the sentinel — so the undici connection stayed checked out of the pool
(8 per origin) instead of being released, causing stalls/timeouts on the
event-read path.
Cancel the source in a try/finally (and cancel the reader in readerToIterator)
via a shared closeQuietly helper. Add regression tests for both decode branches
and a getEventV4 HTTP round-trip through undici MockAgent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8fc2f47

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
NameType
@workflow/world-vercelPatch
@workflow/cliPatch
@workflow/corePatch
@workflow/webPatch
workflowPatch
@workflow/world-testingPatch
@workflow/buildersPatch
@workflow/nextPatch
@workflow/nitroPatch
@workflow/vitestPatch
@workflow/web-sharedPatch
@workflow/astroPatch
@workflow/nestPatch
@workflow/rollupPatch
@workflow/sveltekitPatch
@workflow/vitePatch
@workflow/nuxtPatch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercelBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
❌ ▲ Vercel Production114312241368
✅ 💻 Local Development190902192128
✅ 📦 Local Production190902192128
✅ 🐘 Local Postgres189502332128
✅ 🪟 Windows15200152
✅ 📋 Other88501791064
Total7893110748968

❌ Failed Tests

▲ Vercel Production (1 failed)

nuxt (1 failed):

  • AbortController abortFromStepWorkflow: step abort cancels an in-flight sibling step

Details by Category

❌ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro125027
✅ example125027
✅ express125027
✅ fastify125027
✅ hono125027
✅ nitro125027
❌ nuxt124127
✅ sveltekit14408
✅ vite125027
✅ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable127025
✅ express-stable127025
✅ fastify-stable127025
✅ hono-stable127025
✅ nextjs-turbopack-canary133019
✅ nextjs-turbopack-stable-lazy-discovery-disabled15200
✅ nextjs-turbopack-stable-lazy-discovery-enabled15200
✅ nextjs-webpack-canary133019
✅ nextjs-webpack-stable-lazy-discovery-disabled15200
✅ nextjs-webpack-stable-lazy-discovery-enabled15200
✅ nitro-stable127025
✅ nuxt-stable127025
✅ sveltekit-stable14606
✅ vite-stable127025
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable126026
✅ express-stable126026
✅ fastify-stable126026
✅ hono-stable126026
✅ nextjs-turbopack-canary132020
✅ nextjs-turbopack-stable-lazy-discovery-disabled15101
✅ nextjs-turbopack-stable-lazy-discovery-enabled15101
✅ nextjs-webpack-canary132020
✅ nextjs-webpack-stable-lazy-discovery-disabled15101
✅ nextjs-webpack-stable-lazy-discovery-enabled15101
✅ nitro-stable126026
✅ nuxt-stable126026
✅ sveltekit-stable14507
✅ vite-stable126026
✅ 🪟 Windows
AppPassedFailedSkipped
✅ nextjs-turbopack15200
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable127025
✅ e2e-local-dev-tanstack-start-127025
✅ e2e-local-postgres-nest-stable126026
✅ e2e-local-postgres-tanstack-start-126026
✅ e2e-local-prod-nest-stable127025
✅ e2e-local-prod-tanstack-start-127025
✅ e2e-vercel-prod-tanstack-start125027

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: success
  • Windows: success

Check the workflow run for details.

@github-actions

github-actionsBot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

📊 Benchmark Results

📈 Comparing against baseline from main branch. Green 🟢 = faster, Red 🔺 = slower.

workflow with no steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Nitro0.043s (+6.1% 🔺)1.006s (~)0.963s101.00x
💻 LocalExpress0.045s (+9.7% 🔺)1.006s (~)0.961s101.04x
💻 LocalNext.js (Turbopack)0.051s (+5.6% 🔺)1.006s (~)0.955s101.17x
🐘 PostgresNext.js (Turbopack)0.054s (-6.2% 🟢)1.011s (~)0.957s101.25x
🐘 PostgresNitro0.065s (+3.3%)1.012s (~)0.947s101.50x
🐘 PostgresExpress0.094s (+53.0% 🔺)1.033s (+2.1%)0.939s102.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.364s (-8.4% 🟢)2.332s (-4.3%)1.968s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.090s (-0.9%)2.007s (~)0.916s101.00x
💻 LocalNext.js (Turbopack)1.093s (~)2.007s (~)0.914s101.00x
💻 LocalNitro1.096s (+0.7%)2.007s (~)0.911s101.01x
🐘 PostgresNext.js (Turbopack)1.102s (~)2.011s (~)0.909s101.01x
🐘 PostgresNitro1.112s (+0.7%)2.009s (~)0.897s101.02x
🐘 PostgresExpress1.112s (+0.8%)2.010s (~)0.898s101.02x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.893s (+24.5% 🔺)3.512s (-1.6%)1.619s101.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express10.505s (~)11.012s (~)0.507s31.00x
💻 LocalNitro10.519s (~)11.023s (~)0.504s31.00x
💻 LocalExpress10.523s (~)11.024s (~)0.501s31.00x
🐘 PostgresNext.js (Turbopack)10.527s (~)11.021s (~)0.494s31.00x
💻 LocalNext.js (Turbopack)10.544s (~)11.023s (~)0.479s31.00x
🐘 PostgresNitro10.548s (~)11.018s (~)0.470s31.00x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express13.799s (+5.4% 🔺)15.362s (+1.0%)1.564s21.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.737s (~)14.018s (~)0.281s51.00x
💻 LocalExpress13.742s (-1.8%)14.027s (-1.4%)0.284s51.00x
💻 LocalNitro13.782s (+0.7%)14.028s (~)0.246s51.00x
🐘 PostgresNitro13.805s (-0.7%)14.018s (~)0.213s51.00x
🐘 PostgresNext.js (Turbopack)13.837s (-0.6%)14.023s (~)0.186s51.01x
💻 LocalNext.js (Turbopack)13.855s (+1.1%)14.028s (~)0.174s51.01x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express22.314s (+10.7% 🔺)23.407s (+4.4%)1.092s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)12.376s (-1.2%)13.016s (~)0.639s71.00x
💻 LocalExpress12.387s (-1.6%)13.025s (~)0.638s71.00x
🐘 PostgresNitro12.475s (+0.6%)13.022s (~)0.547s71.01x
💻 LocalNext.js (Turbopack)12.485s (~)13.025s (~)0.541s71.01x
💻 LocalNitro12.649s (+2.9%)13.027s (~)0.378s71.02x
🐘 PostgresExpress13.722s (+10.2% 🔺)14.042s (+7.9% 🔺)0.320s71.11x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.031s (+34.8% 🔺)33.465s (+33.0% 🔺)2.434s31.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (~)2.008s (~)0.854s151.00x
🐘 PostgresNitro1.193s (~)2.009s (~)0.816s151.03x
💻 LocalExpress1.223s (-0.6%)2.006s (~)0.783s151.06x
🐘 PostgresExpress1.236s (+3.4%)2.012s (~)0.776s151.07x
💻 LocalNitro1.238s (+2.9%)2.007s (~)0.769s151.07x
💻 LocalNext.js (Turbopack)1.294s (-5.9% 🟢)2.006s (~)0.712s151.12x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.811s (+4.4%)4.319s (-3.1%)1.508s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.264s (+1.0%)2.009s (~)0.744s151.00x
🐘 PostgresExpress1.271s (-2.8%)2.012s (-3.0%)0.741s151.01x
🐘 PostgresNitro1.276s (+0.5%)2.008s (~)0.732s151.01x
💻 LocalNitro2.000s (-0.8%)2.316s (-7.6% 🟢)0.316s131.58x
💻 LocalExpress2.152s (+5.7% 🔺)2.392s (-4.6%)0.241s131.70x
💻 LocalNext.js (Turbopack)2.297s (-2.0%)2.735s (-6.3% 🟢)0.438s111.82x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.236s (+14.1% 🔺)4.742s (+3.3%)1.506s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.486s (+2.5%)3.762s (+2.2%)2.276s81.00x
🐘 PostgresNext.js (Turbopack)1.516s (+2.3%)3.885s (~)2.369s81.02x
🐘 PostgresExpress1.617s (-2.4%)3.570s (-5.1% 🟢)1.953s91.09x
💻 LocalNitro5.496s (+22.6% 🔺)6.015s (+20.0% 🔺)0.519s53.70x
💻 LocalExpress5.652s (-2.1%)6.016s (-6.2% 🟢)0.364s53.80x
💻 LocalNext.js (Turbopack)6.781s (+1.4%)7.416s (~)0.635s54.56x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.669s (+117.1% 🔺)8.889s (+80.3% 🔺)2.220s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.144s (-2.5%)2.007s (~)0.864s151.00x
🐘 PostgresExpress1.188s (-0.6%)2.014s (~)0.826s151.04x
🐘 PostgresNitro1.203s (~)2.007s (~)0.804s151.05x
💻 LocalExpress1.204s (-2.1%)2.006s (~)0.802s151.05x
💻 LocalNitro1.231s (~)2.007s (~)0.776s151.08x
💻 LocalNext.js (Turbopack)1.393s (+3.1%)2.006s (~)0.614s151.22x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.013s (+48.9% 🔺)4.449s (+13.9% 🔺)1.436s71.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.257s (-0.5%)2.150s (+3.6%)0.893s141.00x
🐘 PostgresExpress1.263s (-2.5%)2.006s (~)0.744s151.00x
🐘 PostgresNitro1.292s (+1.3%)2.008s (~)0.716s151.03x
💻 LocalExpress1.988s (-2.4%)2.470s (-9.8% 🟢)0.482s131.58x
💻 LocalNitro1.997s (-0.6%)2.508s (+8.4% 🔺)0.511s121.59x
💻 LocalNext.js (Turbopack)2.250s (-7.0% 🟢)2.734s (-6.3% 🟢)0.485s111.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.587s (+39.0% 🔺)5.426s (+24.8% 🔺)1.839s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.446s (-0.7%)3.760s (~)2.314s81.00x
🐘 PostgresExpress1.451s (+1.4%)3.677s (-2.2%)2.226s91.00x
🐘 PostgresNext.js (Turbopack)1.477s (+0.5%)4.009s (+3.2%)2.532s81.02x
💻 LocalExpress5.477s (-8.2% 🟢)6.017s (-11.7% 🟢)0.540s53.79x
💻 LocalNitro5.878s (+18.9% 🔺)6.417s (+16.4% 🔺)0.539s54.07x
💻 LocalNext.js (Turbopack)6.700s (-1.3%)7.219s (-3.9%)0.519s54.63x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.783s (+35.9% 🔺)7.504s (+23.1% 🔺)1.721s41.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.518s (-8.3% 🟢)1.006s (-1.7%)0.488s601.00x
🐘 PostgresExpress0.525s (-8.8% 🟢)1.025s (~)0.500s591.01x
🐘 PostgresNitro0.551s (-2.0%)1.006s (-1.6%)0.456s601.06x
💻 LocalExpress0.572s (-6.3% 🟢)1.005s (~)0.433s601.10x
💻 LocalNext.js (Turbopack)0.585s (-4.4%)1.005s (-1.7%)0.420s601.13x
💻 LocalNitro0.604s (+5.9% 🔺)1.005s (-1.6%)0.401s601.17x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.117s (+20.0% 🔺)5.558s (+2.4%)1.441s111.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.258s (-1.4%)2.007s (~)0.749s451.00x
🐘 PostgresExpress1.304s (-1.6%)1.946s (-3.1%)0.641s471.04x
🐘 PostgresNitro1.310s (+2.8%)2.008s (~)0.698s451.04x
💻 LocalExpress1.493s (-4.2%)2.028s (~)0.535s451.19x
💻 LocalNext.js (Turbopack)1.506s (+2.1%)2.006s (~)0.500s451.20x
💻 LocalNitro1.506s (+8.9% 🔺)2.007s (~)0.500s451.20x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express10.059s (+17.3% 🔺)12.286s (+17.8% 🔺)2.227s81.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.356s (-10.6% 🟢)2.984s (-2.4%)0.628s411.00x
🐘 PostgresNext.js (Turbopack)2.527s (-0.9%)3.009s (~)0.482s401.07x
🐘 PostgresNitro2.608s (-1.7%)3.059s (-2.5%)0.451s401.11x
💻 LocalExpress3.231s (-0.6%)3.977s (-0.8%)0.746s311.37x
💻 LocalNext.js (Turbopack)3.258s (+1.7%)4.010s (+0.8%)0.751s301.38x
💻 LocalNitro3.296s (+10.0% 🔺)4.010s (+16.7% 🔺)0.714s301.40x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express19.195s (+27.6% 🔺)21.256s (+23.4% 🔺)2.061s61.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.167s (-6.5% 🟢)1.007s (~)0.840s601.00x
🐘 PostgresExpress0.200s (-8.5% 🟢)1.012s (+0.6%)0.812s601.20x
🐘 PostgresNitro0.229s (+8.3% 🔺)1.006s (~)0.777s601.37x
💻 LocalExpress0.345s (+1.0%)1.005s (~)0.660s602.06x
💻 LocalNitro0.358s (+6.0% 🔺)1.005s (~)0.647s602.14x
💻 LocalNext.js (Turbopack)0.633s (+4.6%)1.039s (+3.4%)0.406s583.79x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.608s (+27.1% 🔺)3.173s (+7.4% 🔺)1.565s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.271s (+1.1%)1.029s (+2.3%)0.758s881.00x
🐘 PostgresNitro0.345s (+6.7% 🔺)1.007s (~)0.662s901.27x
🐘 PostgresExpress0.514s (+60.2% 🔺)1.043s (+3.7%)0.529s871.90x
💻 LocalNitro2.066s (+2.0%)2.537s (+2.8%)0.471s367.62x
💻 LocalExpress2.070s (+5.8% 🔺)2.470s (~)0.400s377.64x
💻 LocalNext.js (Turbopack)2.643s (-0.9%)3.296s (+7.2% 🔺)0.652s289.75x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.327s (+37.2% 🔺)4.125s (+16.7% 🔺)1.798s231.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s (+0.8%)2.936s (-3.2%)2.451s411.00x
🐘 PostgresNitro0.516s (-1.7%)1.068s (+1.8%)0.553s1131.06x
🐘 PostgresExpress0.579s (+17.4% 🔺)1.120s (+10.4% 🔺)0.541s1081.19x
💻 LocalNitro9.822s (+5.0%)10.445s (+3.3%)0.622s1220.23x
💻 LocalExpress9.969s (+1.9%)10.695s (+0.8%)0.726s1220.53x
💻 LocalNext.js (Turbopack)11.201s (+11.3% 🔺)12.131s (+9.1% 🔺)0.929s1023.07x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express4.258s (+75.6% 🔺)6.218s (+42.1% 🔺)1.959s201.00x
▲ VercelNext.js (Turbopack)⚠️missing----
▲ VercelNitro⚠️missing----

🔍 Observability: Express

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.155s (-1.3%)2.001s (~)0.001s (~)2.011s (~)0.856s101.00x
💻 LocalNext.js (Turbopack)1.157s (~)2.003s (~)0.012s (-3.2%)2.019s (~)0.862s101.00x
💻 LocalExpress1.169s (~)2.005s (~)0.012s (-4.1%)2.020s (~)0.851s101.01x
💻 LocalNitro1.171s (+1.8%)2.005s (~)0.013s (+37.0% 🔺)2.020s (~)0.850s101.01x
🐘 PostgresNitro1.176s (+0.6%)1.995s (~)0.001s (-31.6% 🟢)2.011s (~)0.835s101.02x
🐘 PostgresExpress1.269s (+7.7% 🔺)1.971s (-1.2%)0.001s (-42.9% 🟢)2.029s (+0.9%)0.760s101.10x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.523s (+11.7% 🔺)3.515s (+3.1%)2.599s (-4.0%)6.612s (-3.0%)4.090s101.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Express1.576s (-0.5%)2.010s (~)0.012s (~)2.025s (~)0.449s301.00x
🐘 PostgresNext.js (Turbopack)1.595s (~)2.010s (~)0.005s (+10.1% 🔺)2.026s (~)0.430s301.01x
🐘 PostgresNitro1.599s (-2.6%)2.005s (-1.6%)0.005s (+1.3%)2.027s (-1.5%)0.428s301.01x
💻 LocalNitro1.611s (+2.0%)2.010s (~)0.012s (~)2.025s (~)0.415s301.02x
💻 LocalNext.js (Turbopack)1.645s (+1.7%)2.008s (~)0.013s (-1.6%)2.025s (~)0.380s301.04x
🐘 PostgresExpress1.722s (+8.6% 🔺)2.144s (+7.0% 🔺)0.004s (-15.1% 🟢)2.169s (+7.0% 🔺)0.447s281.09x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.853s (+11.7% 🔺)8.340s (+6.3% 🔺)0.224s (-21.0% 🟢)9.063s (+4.5%)2.210s71.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro0.793s (+3.1%)1.070s (-3.1%)0.000s (-1.8%)1.097s (-1.9%)0.304s551.00x
🐘 PostgresNext.js (Turbopack)0.810s (+6.4% 🔺)1.111s (+2.1%)0.000s (+111.1% 🔺)1.119s (+2.1%)0.309s541.02x
🐘 PostgresExpress1.124s (+47.2% 🔺)1.532s (+44.0% 🔺)0.000s (+Infinity% 🔺)1.560s (+44.6% 🔺)0.436s391.42x
💻 LocalExpress1.361s (+2.9%)2.013s (~)0.001s (+54.5% 🔺)2.016s (~)0.655s301.72x
💻 LocalNitro1.377s (+0.9%)2.014s (~)0.001s (+50.0% 🔺)2.017s (~)0.640s301.74x
💻 LocalNext.js (Turbopack)1.496s (+3.3%)2.013s (~)0.001s (+77.8% 🔺)2.017s (~)0.521s301.89x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express3.729s (+10.4% 🔺)4.651s (-7.8% 🟢)0.000s (-54.2% 🟢)5.149s (-7.5% 🟢)1.419s121.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

fan-out fan-in 10 streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Nitro1.578s (-4.7%)2.257s (+1.9%)0.000s (-100.0% 🟢)2.289s (+2.6%)0.711s271.00x
🐘 PostgresNext.js (Turbopack)1.935s (+1.4%)2.544s (~)0.000s (+Infinity% 🔺)2.552s (~)0.617s241.23x
🐘 PostgresExpress2.497s (+63.3% 🔺)3.006s (+43.1% 🔺)0.000s (+33.3% 🔺)3.068s (+42.6% 🔺)0.571s211.58x
💻 LocalExpress3.453s (-5.2% 🟢)3.965s (-6.2% 🟢)0.000s (-43.7% 🟢)3.969s (-6.2% 🟢)0.517s162.19x
💻 LocalNitro3.647s (+4.2%)4.092s (+3.3%)0.000s (-64.4% 🟢)4.099s (+3.2%)0.452s152.31x
💻 LocalNext.js (Turbopack)3.962s (-3.8%)4.529s (-1.5%)0.000s (-72.2% 🟢)4.534s (-1.6%)0.572s142.51x

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express6.001s (-27.3% 🟢)7.053s (-28.6% 🟢)0.000s (-100.0% 🟢)7.582s (-27.4% 🟢)1.581s81.00x
▲ VercelNext.js (Turbopack)⚠️missing-----
▲ VercelNitro⚠️missing-----

🔍 Observability: Express

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalExpress14/21
🐘 PostgresNext.js (Turbopack)14/21
▲ VercelExpress21/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres15/21
Next.js (Turbopack)🐘 Postgres19/21
Nitro🐘 Postgres16/21
Column Definitions
  • Workflow Time: Runtime reported by workflow (completedAt - createdAt) - primary metric
  • TTFB: Time to First Byte - time from workflow start until first stream byte received (stream benchmarks only)
  • Slurp: Time from first byte to complete stream consumption (stream benchmarks only)
  • Wall Time: Total testbench time (trigger workflow + poll for result)
  • Overhead: Testbench overhead (Wall Time - Workflow Time)
  • Samples: Number of benchmark iterations run
  • vs Fastest: How much slower compared to the fastest configuration for this benchmark

Worlds:

  • 💻 Local: In-memory filesystem world (local development)
  • 🐘 Postgres: PostgreSQL database world (local development)
  • ▲ Vercel: Vercel production/preview deployment
  • 🌐 Turso: Community world (local development)
  • 🌐 MongoDB: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Jazz: Community world (local development)
  • 🌐 Redis: Community world (local development)
  • 🌐 Redis + BullMQ: Community world (local development)
  • 🌐 Cloudflare: Community world (local development)
  • 🌐 MySQL: Community world (local development)
  • 🌐 Azure: Community world (local development)
  • 🌐 NATS JetStream: Community world (local development)
  • 🌐 Upstash: Community world (local development)

📋 View full workflow run


Some benchmark jobs failed:

  • Local: success
  • Postgres: success
  • Vercel: failure

Check the workflow run for details.

@vercel
vercelBot requested a deployment to Preview – workbench-express-workflow June 20, 2026 19:05 Abandoned
@smaeda-ks
smaeda-ks marked this pull request as ready for review June 20, 2026 19:12
@smaeda-ks
smaeda-ks requested a review from a team as a code ownerJune 20, 2026 19:12
@VaguelySerious
VaguelySerious merged commit e3672e8 into mainJun 20, 2026
113 of 119 checks passed
@VaguelySerious
VaguelySerious deleted the shohei/conn-leak branch June 20, 2026 19:36
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for e3672e8 (AI decision).

This fix targets the decodeFrames/readerToIterator machinery in packages/world-vercel/src/frames.ts (and tests in frames.test.ts / events-v4.test.ts), none of which exist on stable — verified that stable has no frames.ts, no events-v4.*, and an events.ts with no streaming/frame-decoding logic at all. The v4 frame-stream wire format is main-only, so the bug being fixed does not exist on stable and the change cannot apply there.

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

e3672e84f4996fbd35fc2542d11d401979d76924

pranaygp added a commit that referenced this pull request Jun 22, 2026
…testing
* origin/main:
Version Packages (beta) (#2540)
perf(core): memoize step return value hydration across inline replays (#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (#2412)
Amend lazy discovery removal changeset (#2560)
[docs] Document minimum SDK version for using hook.getConflict (#2423)
Update default CODEOWNERS (#2556)
Optimize and fix the default eager build mode (#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (#2547)" (#2554)
[core] Turbo mode: fast-path the first invocation (#2526)
Remove lazy discovery from workflow/next (#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (#2547)
feat(docs): add eve and AI SDK to product switcher (#2543)
[vitest] Fix local imports failing to load in test step bundles (#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (#2324)
Version Packages (beta) (#2495)
otel(world-vercel): inject trace context on v4 event requests (#2533)
Bump undici to 7.28.0 (#2534)
Default source maps to dev-on / prod-off (#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (#2527)
perf(core): parallel inline steps + optimistic lazy step start (#2516)
pranaygp added a commit to marcopiraccini/workflow that referenced this pull request Jun 22, 2026
* origin/main: (120 commits)
Version Packages (beta) (vercel#2540)
perf(core): memoize step return value hydration across inline replays (vercel#2472)
[core] Fix abort signal not reflected in subsequent step (replay-ordering flake) (vercel#2412)
Amend lazy discovery removal changeset (vercel#2560)
[docs] Document minimum SDK version for using hook.getConflict (vercel#2423)
Update default CODEOWNERS (vercel#2556)
Optimize and fix the default eager build mode (vercel#2546)
Revert "fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)" (vercel#2554)
[core] Turbo mode: fast-path the first invocation (vercel#2526)
Remove lazy discovery from workflow/next (vercel#2545)
fix(world-vercel): cancel v4 event frame stream on early exit (vercel#2547)
feat(docs): add eve and AI SDK to product switcher (vercel#2543)
[vitest] Fix local imports failing to load in test step bundles (vercel#2351)
[builders] Fix unicode-escape crash in workflow graph extraction (vercel#2324)
Version Packages (beta) (vercel#2495)
otel(world-vercel): inject trace context on v4 event requests (vercel#2533)
Bump undici to 7.28.0 (vercel#2534)
Default source maps to dev-on / prod-off (vercel#2529)
otel: nest linked-mode invocations under the delivery context (route + execution in one trace) (vercel#2527)
perf(core): parallel inline steps + optimistic lazy step start (vercel#2516)
...
VaguelySerious added a commit that referenced this pull request Jul 10, 2026
The straight reapply of #2547 awaited chunks.return?.()/reader.cancel()
in decodeFrames' finally block, blocking every early-exit caller
(getEventV4, every replay's list read) on the cancel's completion. On
Vercel's Next.js (turbopack + webpack) Function lanes this hung
indefinitely — confirmed via CI: every single E2E Vercel Prod run got
stuck in "running" after its step completed, for the full 30-minute
window, while all other frameworks passed cleanly in ~15 minutes.
Same failure signature and same two CI lanes as #2807's awaited
reader.cancel() bug in the core abort-stream reader — very likely the
actual (undocumented) reason #2547 was reverted. Fix: fire-and-forget
the cancel, matching #2807's pattern.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@smaeda-ks@VaguelySerious