Skip to content

[world-vercel] Propagate cancel from streams.get to upstream fetch - #1802

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main
Closed

[world-vercel] Propagate cancel from streams.get to upstream fetch#1802
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

Forward-port of #1801 onto main. Same class of bug, different function shape (streams.get(runId, name, startIndex) here vs. readFromStream(name, startIndex) on stable).

When a consumer cancels the ReadableStream returned by streams.get() (e.g. an HTTP client disconnects from an API route that pipes run.getReadable()), the pull loop in the streamer kept running and could trigger further reconnects in the background. The in-flight upstream fetch was never aborted, so the endpoint kept fetching long after the client had gone away.

Root cause

  1. No cancelled flag — pull had no way to know the consumer asked to stop.
  2. No AbortSignal on the upstream fetch() — even if we noticed, there was no way to unblock a pending request.

The cancel handler only called reader.cancel() on whichever reader was captured at that moment. If pull was mid-reconnect (reader = await connect()), cancel cancelled the stale reader; the new fetch then connected and kept streaming.

Fix

  • Track a cancelled flag that pull checks before and after each reader.read() and before each connect().
  • Plumb an AbortController.signal into fetch, aborted from cancel, so the in-flight request (including a pending reconnect) unblocks.
  • connect() failures triggered by abort are swallowed silently when cancelled.

Tests

Three new tests under a new streams.get consumer cancel describe block:

  • aborts the in-flight upstream fetch via AbortSignal — fails on main without the fix; asserts fetch was called with an AbortSignal and that the signal is aborted after stream.cancel().
  • does not reconnect after the consumer cancels mid-timeout — documents that no further fetch is initiated after cancel.
  • cancels the active reader when cancel is called during a read — documents that cancel unblocks a pending reader.read().

All 32 world-vercel streamer tests pass locally.

Companion

Test plan

  • pnpm vitest run — all world-vercel tests pass
  • Typecheck clean
  • CI + workflow-server auto e2e

🤖 Generated with Claude Code

When a consumer cancels the ReadableStream returned by streams.get
(e.g. an HTTP client hanging up on an endpoint that pipes
`run.getReadable()`), the pull loop could continue running and even
trigger a fresh reconnect via `connect()` — the new fetch was never
tied to the cancellation, so the request kept running in the
background.
Fix:
- Track a `cancelled` flag that `pull` checks before and after each
read and before each reconnect.
- Plumb an `AbortController.signal` into `fetch` so the in-flight
upstream request (including a pending reconnect) is aborted when
the consumer cancels.
Regression tests cover the abort-signal contract, the mid-timeout
reconnect race, and cancel-during-read.
Port of #1801 (targeting `stable`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9de9271

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

This PR includes changesets to release 18 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/aiPatch
@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 Apr 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9450671012
❌ 💻 Local Development10171861104
✅ 📦 Local Production10180861104
✅ 🐘 Local Postgres10180861104
✅ 📋 Other258018276
Total425613434600

❌ Failed Tests

💻 Local Development (1 failed)

vite-stable (1 failed):

  • hookWorkflow | wrun_01KPEF76M376DM0WQEFASYBKMY

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8507
✅ example8507
✅ express8507
✅ fastify8507
✅ hono8507
✅ nextjs-turbopack9002
✅ nextjs-webpack9002
✅ nitro8507
✅ nuxt8507
✅ sveltekit8507
✅ vite8507
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
❌ vite-stable8516
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8606
✅ e2e-local-postgres-nest-stable8606
✅ e2e-local-prod-nest-stable8606

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 17, 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.044s (+1.4%)1.005s (~)0.962s101.00x
💻 LocalExpress0.044s (-0.9%)1.005s (~)0.961s101.00x
💻 LocalNext.js (Turbopack)0.048s1.005s0.957s101.09x
🐘 PostgresExpress0.057s (-2.1%)1.011s (~)0.955s101.30x
🐘 PostgresNext.js (Turbopack)0.058s1.009s0.951s101.33x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.215s (-8.6% 🟢)1.900s (-11.0% 🟢)1.685s101.00x
▲ VercelNitro0.254s (-38.0% 🟢)1.794s (-28.5% 🟢)1.540s101.18x
▲ VercelNext.js (Turbopack)0.264s (+5.1% 🔺)2.153s (-7.7% 🟢)1.889s101.23x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.123s2.005s0.882s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.878s101.00x
💻 LocalExpress1.129s (~)2.005s (~)0.876s101.00x
🐘 PostgresNext.js (Turbopack)1.139s2.009s0.870s101.01x
🐘 PostgresExpress1.153s (+0.5%)2.010s (~)0.857s101.03x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.945s (+3.7%)3.789s (~)1.844s101.00x
▲ VercelNext.js (Turbopack)2.087s (+2.5%)3.450s (-9.9% 🟢)1.363s101.07x
▲ VercelNitro2.112s (-45.7% 🟢)3.337s (-43.5% 🟢)1.225s101.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.778s11.022s0.245s31.00x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.01x
💻 LocalExpress10.927s (~)11.023s (~)0.097s31.01x
🐘 PostgresNext.js (Turbopack)10.939s11.020s0.082s31.01x
💻 LocalNitro10.942s (~)11.023s (~)0.081s31.02x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)19.107s (+10.3% 🔺)20.648s (+6.4% 🔺)1.542s21.00x
▲ VercelExpress20.625s (+21.5% 🔺)22.950s (+14.6% 🔺)2.326s21.08x
▲ VercelNitro22.424s (-5.5% 🟢)24.009s (-4.4%)1.585s21.17x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.499s15.020s0.520s41.00x
💻 LocalNext.js (Turbopack)14.627s15.029s0.402s41.01x
🐘 PostgresExpress14.633s (~)15.025s (~)0.392s41.01x
💻 LocalNitro14.994s (~)15.280s (-4.7%)0.286s41.03x
💻 LocalExpress15.033s (~)15.280s (+1.7%)0.247s41.04x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.730s (-36.9% 🟢)33.288s (-36.7% 🟢)1.558s21.00x
▲ VercelNitro32.513s (-49.6% 🟢)33.549s (-49.6% 🟢)1.037s21.02x
▲ VercelNext.js (Turbopack)34.645s (-34.1% 🟢)36.196s (-33.7% 🟢)1.551s21.09x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.972s (~)14.310s (-1.9%)0.338s71.00x
🐘 PostgresNext.js (Turbopack)13.996s14.306s0.310s71.00x
💻 LocalNext.js (Turbopack)16.008s16.363s0.354s61.15x
💻 LocalNitro16.765s (~)17.031s (~)0.266s61.20x
💻 LocalExpress16.821s (+1.3%)17.199s (+1.0%)0.378s61.20x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express55.760s (-54.0% 🟢)57.850s (-53.2% 🟢)2.090s21.00x
▲ VercelNext.js (Turbopack)58.773s (-85.1% 🟢)60.892s (-84.6% 🟢)2.119s21.05x
▲ VercelNitro58.992s (-86.1% 🟢)59.843s (-85.9% 🟢)0.852s21.06x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.237s2.009s0.771s151.00x
🐘 PostgresExpress1.271s (+0.8%)2.010s (~)0.739s151.03x
💻 LocalNext.js (Turbopack)1.565s2.073s0.508s151.26x
💻 LocalNitro1.569s (-3.8%)2.006s (-3.3%)0.438s151.27x
💻 LocalExpress1.591s (+6.9% 🔺)2.072s (+3.3%)0.481s151.29x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.177s (-23.9% 🟢)3.957s (-14.4% 🟢)1.780s81.00x
▲ VercelNitro2.266s (-19.6% 🟢)3.575s (-17.3% 🟢)1.309s91.04x
▲ VercelNext.js (Turbopack)2.491s (-26.7% 🟢)3.966s (-19.6% 🟢)1.475s81.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.326s (-1.5%)3.008s (~)0.682s101.00x
🐘 PostgresNext.js (Turbopack)2.414s3.009s0.595s101.04x
💻 LocalExpress2.853s (-3.4%)3.209s (-7.1% 🟢)0.355s101.23x
💻 LocalNext.js (Turbopack)2.870s3.109s0.239s101.23x
💻 LocalNitro3.075s (-2.2%)3.676s (-5.4% 🟢)0.602s91.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.427s (-40.1% 🟢)3.659s (-38.2% 🟢)1.232s91.00x
▲ VercelExpress2.597s (-28.2% 🟢)3.934s (-23.0% 🟢)1.337s81.07x
▲ VercelNext.js (Turbopack)2.605s (-63.3% 🟢)4.047s (-54.6% 🟢)1.442s81.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.487s (~)4.009s (~)0.522s81.00x
🐘 PostgresNext.js (Turbopack)3.660s4.010s0.350s81.05x
💻 LocalNext.js (Turbopack)7.234s7.765s0.532s42.07x
💻 LocalExpress7.298s (-12.5% 🟢)8.019s (-11.2% 🟢)0.721s42.09x
💻 LocalNitro8.550s (+2.4%)9.025s (~)0.475s42.45x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.074s (-12.8% 🟢)4.414s (-20.2% 🟢)1.340s81.00x
▲ VercelExpress3.138s (-26.0% 🟢)5.027s (-18.0% 🟢)1.889s71.02x
▲ VercelNext.js (Turbopack)4.736s (-46.9% 🟢)6.298s (-42.5% 🟢)1.562s51.54x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.235s2.009s0.774s151.00x
🐘 PostgresExpress1.264s (+0.5%)2.007s (~)0.744s151.02x
💻 LocalNext.js (Turbopack)1.508s2.005s0.497s151.22x
💻 LocalExpress1.517s (-19.9% 🟢)2.006s (-15.1% 🟢)0.489s151.23x
💻 LocalNitro1.557s (-16.5% 🟢)2.006s (-14.3% 🟢)0.449s151.26x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.144s (-16.9% 🟢)4.110s (-5.5% 🟢)1.966s81.00x
▲ VercelNext.js (Turbopack)2.156s (-26.5% 🟢)3.524s (-24.1% 🟢)1.368s91.01x
▲ VercelNitro2.427s (-1.3%)3.595s (-13.8% 🟢)1.168s91.13x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.352s (~)3.009s (~)0.657s101.00x
🐘 PostgresNext.js (Turbopack)2.387s3.009s0.622s101.01x
💻 LocalExpress2.940s (-6.1% 🟢)3.341s (-11.2% 🟢)0.401s91.25x
💻 LocalNext.js (Turbopack)2.961s3.760s0.799s81.26x
💻 LocalNitro3.055s (~)3.759s (-3.3%)0.704s81.30x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.296s (-28.1% 🟢)3.931s (-18.0% 🟢)1.635s81.00x
▲ VercelNitro2.679s (-17.1% 🟢)3.957s (-22.1% 🟢)1.277s91.17x
▲ VercelNext.js (Turbopack)2.758s (-12.2% 🟢)4.045s (-10.5% 🟢)1.287s81.20x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.489s (~)4.011s (~)0.521s81.00x
🐘 PostgresNext.js (Turbopack)3.668s4.010s0.341s81.05x
💻 LocalExpress7.974s (-9.4% 🟢)8.524s (-8.1% 🟢)0.549s42.29x
💻 LocalNext.js (Turbopack)8.849s9.524s0.675s42.54x
💻 LocalNitro9.056s (-1.0%)9.523s (-5.0% 🟢)0.467s42.60x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.854s (-44.0% 🟢)4.359s (-36.1% 🟢)1.505s71.00x
▲ VercelExpress2.952s (-54.0% 🟢)4.606s (-43.7% 🟢)1.655s71.03x
▲ VercelNext.js (Turbopack)3.820s (-43.5% 🟢)5.366s (-37.2% 🟢)1.546s61.34x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.778s1.023s0.244s591.00x
🐘 PostgresExpress0.822s (-2.1%)1.006s (-1.6%)0.185s601.06x
💻 LocalNext.js (Turbopack)0.844s1.004s0.160s601.08x
💻 LocalExpress1.013s (+3.0%)1.672s (+55.4% 🔺)0.659s361.30x
💻 LocalNitro1.026s (+4.7%)1.800s (+64.6% 🔺)0.774s341.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)9.041s (-37.7% 🟢)10.605s (-34.1% 🟢)1.564s61.00x
▲ VercelNitro9.167s (-58.4% 🟢)10.774s (-55.2% 🟢)1.608s61.01x
▲ VercelExpress9.420s (-50.5% 🟢)10.934s (-48.7% 🟢)1.514s61.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.908s2.124s0.216s431.00x
🐘 PostgresExpress1.976s (~)2.258s (~)0.282s401.04x
💻 LocalNext.js (Turbopack)2.641s3.007s0.366s301.38x
💻 LocalExpress3.022s (~)3.689s (+2.9%)0.667s251.58x
💻 LocalNitro3.063s (+0.9%)3.922s (+4.4%)0.859s231.61x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)28.897s (-42.0% 🟢)30.300s (-41.4% 🟢)1.404s31.00x
▲ VercelNitro29.540s (-25.2% 🟢)31.066s (-24.8% 🟢)1.525s31.02x
▲ VercelExpress29.717s (-13.9% 🟢)31.535s (-14.3% 🟢)1.818s31.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.867s4.010s0.143s301.00x
🐘 PostgresExpress4.012s (+0.5%)4.493s (+2.8%)0.482s271.04x
💻 LocalNext.js (Turbopack)8.486s9.017s0.531s142.19x
💻 LocalExpress9.064s (-1.6%)9.478s (-5.4% 🟢)0.414s132.34x
💻 LocalNitro9.278s (~)9.942s (-0.8%)0.664s132.40x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro71.447s (-26.3% 🟢)73.075s (-25.8% 🟢)1.628s21.00x
▲ VercelExpress72.056s (-44.6% 🟢)73.881s (-44.1% 🟢)1.825s21.01x
▲ VercelNext.js (Turbopack)74.567s (-30.4% 🟢)76.256s (-30.0% 🟢)1.690s21.04x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.249s1.007s0.758s601.00x
🐘 PostgresExpress0.289s (+2.3%)1.007s (~)0.718s601.16x
💻 LocalNext.js (Turbopack)0.544s1.004s0.461s602.19x
💻 LocalNitro0.592s (-2.1%)1.022s (~)0.430s592.38x
💻 LocalExpress0.604s (+7.8% 🔺)1.021s (+1.7%)0.417s592.43x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.416s (-27.6% 🟢)2.982s (-18.0% 🟢)1.567s211.00x
▲ VercelNitro1.604s (-3.4%)2.969s (-11.4% 🟢)1.365s211.13x
▲ VercelNext.js (Turbopack)1.608s (-20.5% 🟢)3.112s (-18.0% 🟢)1.504s201.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s1.006s0.520s901.00x
🐘 PostgresExpress0.501s (-1.7%)1.007s (~)0.506s901.03x
💻 LocalExpress2.376s (-5.5% 🟢)3.008s (~)0.632s304.89x
💻 LocalNext.js (Turbopack)2.525s3.009s0.484s305.20x
💻 LocalNitro2.585s (+1.9%)3.009s (~)0.424s305.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.851s (-11.6% 🟢)4.168s (-13.5% 🟢)1.317s221.00x
▲ VercelExpress2.858s (-6.2% 🟢)4.555s (-5.2% 🟢)1.697s201.00x
▲ VercelNext.js (Turbopack)3.341s (-5.5% 🟢)4.972s (-4.3%)1.631s191.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.781s1.007s0.225s1201.00x
🐘 PostgresExpress0.822s (~)1.010s (-0.7%)0.188s1191.05x
💻 LocalExpress10.571s (-5.5% 🟢)11.027s (-7.7% 🟢)0.456s1113.53x
💻 LocalNext.js (Turbopack)10.643s11.207s0.564s1113.63x
💻 LocalNitro11.261s (+0.6%)11.848s (+1.6%)0.587s1114.42x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.395s (-28.4% 🟢)9.144s (-25.6% 🟢)1.748s141.00x
▲ VercelExpress7.507s (+1.2%)9.507s (+2.8%)2.000s131.02x
▲ VercelNitro7.762s (+0.5%)9.268s (-1.4%)1.505s131.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.169s1.003s0.012s1.018s0.848s101.00x
🐘 PostgresExpress0.203s (-1.0%)1.000s (~)0.002s (-6.3% 🟢)1.010s (~)0.807s101.20x
💻 LocalNitro0.204s (-4.6%)1.004s (~)0.011s (-9.6% 🟢)1.018s (~)0.814s101.21x
🐘 PostgresNext.js (Turbopack)0.204s1.001s0.001s1.011s0.806s101.21x
💻 LocalExpress0.227s (+14.2% 🔺)1.004s (~)0.010s (-18.2% 🟢)1.016s (~)0.788s101.34x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.495s (-78.2% 🟢)2.793s (-67.7% 🟢)0.933s (+47.7% 🔺)4.135s (-57.8% 🟢)2.641s101.00x
▲ VercelExpress1.627s (-35.1% 🟢)3.231s (-21.0% 🟢)0.668s (-30.5% 🟢)4.341s (-22.3% 🟢)2.715s101.09x
▲ VercelNitro1.672s (-56.4% 🟢)2.805s (-46.8% 🟢)1.109s (+49.4% 🔺)4.338s (-33.1% 🟢)2.665s101.12x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.609s1.009s0.005s1.022s0.413s591.00x
🐘 PostgresExpress0.632s (~)1.021s (+1.4%)0.004s (+4.4%)1.042s (+1.8%)0.410s581.04x
💻 LocalNext.js (Turbopack)0.756s1.011s0.010s1.117s0.361s541.24x
💻 LocalNitro0.769s (-8.3% 🟢)1.012s (~)0.012s (+25.4% 🔺)1.026s (-8.1% 🟢)0.257s591.26x
💻 LocalExpress0.857s (+13.1% 🔺)1.012s (-1.7%)0.012s (+22.4% 🔺)1.118s (+7.5% 🔺)0.262s541.41x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.777s (-11.2% 🟢)7.473s (-6.7% 🟢)0.185s (-54.8% 🟢)8.112s (-8.2% 🟢)2.335s81.00x
▲ VercelNext.js (Turbopack)6.719s (-60.3% 🟢)8.047s (-55.9% 🟢)0.186s (-11.8% 🟢)8.612s (-54.5% 🟢)1.892s71.16x
▲ VercelNitro8.246s (-72.0% 🟢)9.624s (-68.8% 🟢)0.167s (+48.7% 🔺)10.158s (-68.0% 🟢)1.912s61.43x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.919s1.072s0.000s1.080s0.161s561.00x
🐘 PostgresExpress0.984s (+2.4%)1.301s (+1.8%)0.000s (~)1.328s (+1.7%)0.344s461.07x
💻 LocalExpress1.238s (+1.0%)2.020s (~)0.000s (+30.0% 🔺)2.022s (~)0.785s301.35x
💻 LocalNext.js (Turbopack)1.241s2.019s0.000s2.022s0.781s301.35x
💻 LocalNitro1.433s (+17.2% 🔺)2.023s (~)0.000s (+292.9% 🔺)2.204s (+9.0% 🔺)0.771s281.56x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.869s (-6.0% 🟢)4.073s (-7.3% 🟢)0.000s (-7.1% 🟢)4.417s (-8.2% 🟢)1.548s141.00x
▲ VercelExpress2.934s (-21.6% 🟢)4.316s (-15.4% 🟢)0.000s (-100.0% 🟢)4.733s (-14.4% 🟢)1.799s131.02x
▲ VercelNext.js (Turbopack)3.017s (-70.4% 🟢)4.293s (-62.7% 🟢)0.000s (+Infinity% 🔺)4.672s (-61.2% 🟢)1.655s141.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.793s (+1.2%)2.143s (-1.6%)0.000s (+Infinity% 🔺)2.152s (-2.1%)0.359s281.00x
🐘 PostgresNext.js (Turbopack)1.844s2.145s0.000s2.152s0.308s281.03x
💻 LocalNext.js (Turbopack)3.508s4.033s0.000s4.036s0.528s151.96x
💻 LocalExpress3.603s (+3.9%)4.101s (+1.7%)0.001s (-8.3% 🟢)4.105s (+1.7%)0.502s152.01x
💻 LocalNitro3.674s (+8.5% 🔺)4.164s (+3.3%)0.001s (~)4.167s (+3.2%)0.493s152.05x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.063s (-0.8%)5.253s (-2.2%)0.000s (-100.0% 🟢)5.588s (-3.5%)1.526s111.00x
▲ VercelExpress4.167s (-9.2% 🟢)5.682s (-5.6% 🟢)0.000s (NaN%)6.087s (-5.7% 🟢)1.920s111.03x
▲ VercelNext.js (Turbopack)4.455s (-20.7% 🟢)5.836s (-16.4% 🟢)0.000s (-100.0% 🟢)6.230s (-17.4% 🟢)1.774s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)14/21
🐘 PostgresNext.js (Turbopack)12/21
▲ VercelExpress9/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres16/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro💻 Local16/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)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

Comment thread.changeset/stream-cancel-propagation-main.md Outdated
Comment threadpackages/world-vercel/src/streamer.ts Outdated
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, well-scoped fix. Forward-port of #1801 for main. The approach — cancelled flag as the source of truth plus a single shared AbortController for the whole stream lifetime — is the right pattern for this class of bug.

What looks good

  • Cancellation checks at all the right points: before reader.read(), after reader.read() (covers the case where read completed naturally between abort and flag check), and before reconnect(). Combined with the AbortController plumbed into fetch, this covers all the race windows:

    • Cancel before any pull → initial reader gets cancelled, pull is never invoked
    • Cancel during active read → AbortError swallowed, exits cleanly
    • Cancel during reconnect → in-flight fetch aborted, caught, exits cleanly
    • Cancel between reconnect completion and next read → flag checked at top of loop
  • Shared AbortController across all reconnects is correct. Once aborted, it stays aborted, which means all future connect() calls abort instantly. Right primitive for whole-stream cancellation.

  • Reconnect try/catch properly distinguishes abort-from-cancel (return silently) vs. real errors (propagate via controller.error).

  • reader.cancel().catch() on the closure variable — the comment explicitly acknowledges the TOCTOU window and explains why the cancelled flag is the real guarantee. Good defense-in-depth comment.

  • Changeset correctly scoped to @workflow/world-vercel only.

Test coverage observations

The PR description calls out test 1 (aborts the in-flight upstream fetch via AbortSignal) as failing on main without the fix — I agree, that's the strongest test.

Tests 2 and 3 are more like documentation/regression guards than fix verifications:

  • Test 2 (does not reconnect after the consumer cancels mid-timeout): the test never calls read() after the first one, so pull is never re-invoked — no reconnect path is actually exercised. Pre-fix, fetchCount would also be 1 simply because there's no trigger for a second pull. To really exercise the race, the test would need to let pull enter the reconnect branch before cancel (e.g. drain all data + timeout frame before cancelling). That said, it's still useful as a guard against future regressions where someone might trigger reconnects asynchronously.
  • Test 3 (cancels the active reader when cancel is called during a read): WHATWG streams semantics already make reader.cancel() propagate to the upstream body reader, so this likely passed pre-fix too.

Not blocking — the primary fix is well-verified by test 1.

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

@VaguelySerious@TooTallNate
, '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" + '
[world-vercel] Propagate cancel from streams.get to upstream fetch by VaguelySerious · Pull Request #1802 · vercel/workflow · GitHub
Skip to content

[world-vercel] Propagate cancel from streams.get to upstream fetch - #1802

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main
Closed

[world-vercel] Propagate cancel from streams.get to upstream fetch#1802
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

Forward-port of #1801 onto main. Same class of bug, different function shape (streams.get(runId, name, startIndex) here vs. readFromStream(name, startIndex) on stable).

When a consumer cancels the ReadableStream returned by streams.get() (e.g. an HTTP client disconnects from an API route that pipes run.getReadable()), the pull loop in the streamer kept running and could trigger further reconnects in the background. The in-flight upstream fetch was never aborted, so the endpoint kept fetching long after the client had gone away.

Root cause

  1. No cancelled flag — pull had no way to know the consumer asked to stop.
  2. No AbortSignal on the upstream fetch() — even if we noticed, there was no way to unblock a pending request.

The cancel handler only called reader.cancel() on whichever reader was captured at that moment. If pull was mid-reconnect (reader = await connect()), cancel cancelled the stale reader; the new fetch then connected and kept streaming.

Fix

  • Track a cancelled flag that pull checks before and after each reader.read() and before each connect().
  • Plumb an AbortController.signal into fetch, aborted from cancel, so the in-flight request (including a pending reconnect) unblocks.
  • connect() failures triggered by abort are swallowed silently when cancelled.

Tests

Three new tests under a new streams.get consumer cancel describe block:

  • aborts the in-flight upstream fetch via AbortSignal — fails on main without the fix; asserts fetch was called with an AbortSignal and that the signal is aborted after stream.cancel().
  • does not reconnect after the consumer cancels mid-timeout — documents that no further fetch is initiated after cancel.
  • cancels the active reader when cancel is called during a read — documents that cancel unblocks a pending reader.read().

All 32 world-vercel streamer tests pass locally.

Companion

Test plan

  • pnpm vitest run — all world-vercel tests pass
  • Typecheck clean
  • CI + workflow-server auto e2e

🤖 Generated with Claude Code

When a consumer cancels the ReadableStream returned by streams.get
(e.g. an HTTP client hanging up on an endpoint that pipes
`run.getReadable()`), the pull loop could continue running and even
trigger a fresh reconnect via `connect()` — the new fetch was never
tied to the cancellation, so the request kept running in the
background.
Fix:
- Track a `cancelled` flag that `pull` checks before and after each
read and before each reconnect.
- Plumb an `AbortController.signal` into `fetch` so the in-flight
upstream request (including a pending reconnect) is aborted when
the consumer cancels.
Regression tests cover the abort-signal contract, the mid-timeout
reconnect race, and cancel-during-read.
Port of #1801 (targeting `stable`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9de9271

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

This PR includes changesets to release 18 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/aiPatch
@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 Apr 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9450671012
❌ 💻 Local Development10171861104
✅ 📦 Local Production10180861104
✅ 🐘 Local Postgres10180861104
✅ 📋 Other258018276
Total425613434600

❌ Failed Tests

💻 Local Development (1 failed)

vite-stable (1 failed):

  • hookWorkflow | wrun_01KPEF76M376DM0WQEFASYBKMY

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8507
✅ example8507
✅ express8507
✅ fastify8507
✅ hono8507
✅ nextjs-turbopack9002
✅ nextjs-webpack9002
✅ nitro8507
✅ nuxt8507
✅ sveltekit8507
✅ vite8507
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
❌ vite-stable8516
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8606
✅ e2e-local-postgres-nest-stable8606
✅ e2e-local-prod-nest-stable8606

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 17, 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.044s (+1.4%)1.005s (~)0.962s101.00x
💻 LocalExpress0.044s (-0.9%)1.005s (~)0.961s101.00x
💻 LocalNext.js (Turbopack)0.048s1.005s0.957s101.09x
🐘 PostgresExpress0.057s (-2.1%)1.011s (~)0.955s101.30x
🐘 PostgresNext.js (Turbopack)0.058s1.009s0.951s101.33x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.215s (-8.6% 🟢)1.900s (-11.0% 🟢)1.685s101.00x
▲ VercelNitro0.254s (-38.0% 🟢)1.794s (-28.5% 🟢)1.540s101.18x
▲ VercelNext.js (Turbopack)0.264s (+5.1% 🔺)2.153s (-7.7% 🟢)1.889s101.23x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.123s2.005s0.882s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.878s101.00x
💻 LocalExpress1.129s (~)2.005s (~)0.876s101.00x
🐘 PostgresNext.js (Turbopack)1.139s2.009s0.870s101.01x
🐘 PostgresExpress1.153s (+0.5%)2.010s (~)0.857s101.03x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.945s (+3.7%)3.789s (~)1.844s101.00x
▲ VercelNext.js (Turbopack)2.087s (+2.5%)3.450s (-9.9% 🟢)1.363s101.07x
▲ VercelNitro2.112s (-45.7% 🟢)3.337s (-43.5% 🟢)1.225s101.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.778s11.022s0.245s31.00x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.01x
💻 LocalExpress10.927s (~)11.023s (~)0.097s31.01x
🐘 PostgresNext.js (Turbopack)10.939s11.020s0.082s31.01x
💻 LocalNitro10.942s (~)11.023s (~)0.081s31.02x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)19.107s (+10.3% 🔺)20.648s (+6.4% 🔺)1.542s21.00x
▲ VercelExpress20.625s (+21.5% 🔺)22.950s (+14.6% 🔺)2.326s21.08x
▲ VercelNitro22.424s (-5.5% 🟢)24.009s (-4.4%)1.585s21.17x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.499s15.020s0.520s41.00x
💻 LocalNext.js (Turbopack)14.627s15.029s0.402s41.01x
🐘 PostgresExpress14.633s (~)15.025s (~)0.392s41.01x
💻 LocalNitro14.994s (~)15.280s (-4.7%)0.286s41.03x
💻 LocalExpress15.033s (~)15.280s (+1.7%)0.247s41.04x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.730s (-36.9% 🟢)33.288s (-36.7% 🟢)1.558s21.00x
▲ VercelNitro32.513s (-49.6% 🟢)33.549s (-49.6% 🟢)1.037s21.02x
▲ VercelNext.js (Turbopack)34.645s (-34.1% 🟢)36.196s (-33.7% 🟢)1.551s21.09x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.972s (~)14.310s (-1.9%)0.338s71.00x
🐘 PostgresNext.js (Turbopack)13.996s14.306s0.310s71.00x
💻 LocalNext.js (Turbopack)16.008s16.363s0.354s61.15x
💻 LocalNitro16.765s (~)17.031s (~)0.266s61.20x
💻 LocalExpress16.821s (+1.3%)17.199s (+1.0%)0.378s61.20x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express55.760s (-54.0% 🟢)57.850s (-53.2% 🟢)2.090s21.00x
▲ VercelNext.js (Turbopack)58.773s (-85.1% 🟢)60.892s (-84.6% 🟢)2.119s21.05x
▲ VercelNitro58.992s (-86.1% 🟢)59.843s (-85.9% 🟢)0.852s21.06x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.237s2.009s0.771s151.00x
🐘 PostgresExpress1.271s (+0.8%)2.010s (~)0.739s151.03x
💻 LocalNext.js (Turbopack)1.565s2.073s0.508s151.26x
💻 LocalNitro1.569s (-3.8%)2.006s (-3.3%)0.438s151.27x
💻 LocalExpress1.591s (+6.9% 🔺)2.072s (+3.3%)0.481s151.29x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.177s (-23.9% 🟢)3.957s (-14.4% 🟢)1.780s81.00x
▲ VercelNitro2.266s (-19.6% 🟢)3.575s (-17.3% 🟢)1.309s91.04x
▲ VercelNext.js (Turbopack)2.491s (-26.7% 🟢)3.966s (-19.6% 🟢)1.475s81.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.326s (-1.5%)3.008s (~)0.682s101.00x
🐘 PostgresNext.js (Turbopack)2.414s3.009s0.595s101.04x
💻 LocalExpress2.853s (-3.4%)3.209s (-7.1% 🟢)0.355s101.23x
💻 LocalNext.js (Turbopack)2.870s3.109s0.239s101.23x
💻 LocalNitro3.075s (-2.2%)3.676s (-5.4% 🟢)0.602s91.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.427s (-40.1% 🟢)3.659s (-38.2% 🟢)1.232s91.00x
▲ VercelExpress2.597s (-28.2% 🟢)3.934s (-23.0% 🟢)1.337s81.07x
▲ VercelNext.js (Turbopack)2.605s (-63.3% 🟢)4.047s (-54.6% 🟢)1.442s81.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.487s (~)4.009s (~)0.522s81.00x
🐘 PostgresNext.js (Turbopack)3.660s4.010s0.350s81.05x
💻 LocalNext.js (Turbopack)7.234s7.765s0.532s42.07x
💻 LocalExpress7.298s (-12.5% 🟢)8.019s (-11.2% 🟢)0.721s42.09x
💻 LocalNitro8.550s (+2.4%)9.025s (~)0.475s42.45x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.074s (-12.8% 🟢)4.414s (-20.2% 🟢)1.340s81.00x
▲ VercelExpress3.138s (-26.0% 🟢)5.027s (-18.0% 🟢)1.889s71.02x
▲ VercelNext.js (Turbopack)4.736s (-46.9% 🟢)6.298s (-42.5% 🟢)1.562s51.54x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.235s2.009s0.774s151.00x
🐘 PostgresExpress1.264s (+0.5%)2.007s (~)0.744s151.02x
💻 LocalNext.js (Turbopack)1.508s2.005s0.497s151.22x
💻 LocalExpress1.517s (-19.9% 🟢)2.006s (-15.1% 🟢)0.489s151.23x
💻 LocalNitro1.557s (-16.5% 🟢)2.006s (-14.3% 🟢)0.449s151.26x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.144s (-16.9% 🟢)4.110s (-5.5% 🟢)1.966s81.00x
▲ VercelNext.js (Turbopack)2.156s (-26.5% 🟢)3.524s (-24.1% 🟢)1.368s91.01x
▲ VercelNitro2.427s (-1.3%)3.595s (-13.8% 🟢)1.168s91.13x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.352s (~)3.009s (~)0.657s101.00x
🐘 PostgresNext.js (Turbopack)2.387s3.009s0.622s101.01x
💻 LocalExpress2.940s (-6.1% 🟢)3.341s (-11.2% 🟢)0.401s91.25x
💻 LocalNext.js (Turbopack)2.961s3.760s0.799s81.26x
💻 LocalNitro3.055s (~)3.759s (-3.3%)0.704s81.30x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.296s (-28.1% 🟢)3.931s (-18.0% 🟢)1.635s81.00x
▲ VercelNitro2.679s (-17.1% 🟢)3.957s (-22.1% 🟢)1.277s91.17x
▲ VercelNext.js (Turbopack)2.758s (-12.2% 🟢)4.045s (-10.5% 🟢)1.287s81.20x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.489s (~)4.011s (~)0.521s81.00x
🐘 PostgresNext.js (Turbopack)3.668s4.010s0.341s81.05x
💻 LocalExpress7.974s (-9.4% 🟢)8.524s (-8.1% 🟢)0.549s42.29x
💻 LocalNext.js (Turbopack)8.849s9.524s0.675s42.54x
💻 LocalNitro9.056s (-1.0%)9.523s (-5.0% 🟢)0.467s42.60x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.854s (-44.0% 🟢)4.359s (-36.1% 🟢)1.505s71.00x
▲ VercelExpress2.952s (-54.0% 🟢)4.606s (-43.7% 🟢)1.655s71.03x
▲ VercelNext.js (Turbopack)3.820s (-43.5% 🟢)5.366s (-37.2% 🟢)1.546s61.34x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.778s1.023s0.244s591.00x
🐘 PostgresExpress0.822s (-2.1%)1.006s (-1.6%)0.185s601.06x
💻 LocalNext.js (Turbopack)0.844s1.004s0.160s601.08x
💻 LocalExpress1.013s (+3.0%)1.672s (+55.4% 🔺)0.659s361.30x
💻 LocalNitro1.026s (+4.7%)1.800s (+64.6% 🔺)0.774s341.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)9.041s (-37.7% 🟢)10.605s (-34.1% 🟢)1.564s61.00x
▲ VercelNitro9.167s (-58.4% 🟢)10.774s (-55.2% 🟢)1.608s61.01x
▲ VercelExpress9.420s (-50.5% 🟢)10.934s (-48.7% 🟢)1.514s61.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.908s2.124s0.216s431.00x
🐘 PostgresExpress1.976s (~)2.258s (~)0.282s401.04x
💻 LocalNext.js (Turbopack)2.641s3.007s0.366s301.38x
💻 LocalExpress3.022s (~)3.689s (+2.9%)0.667s251.58x
💻 LocalNitro3.063s (+0.9%)3.922s (+4.4%)0.859s231.61x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)28.897s (-42.0% 🟢)30.300s (-41.4% 🟢)1.404s31.00x
▲ VercelNitro29.540s (-25.2% 🟢)31.066s (-24.8% 🟢)1.525s31.02x
▲ VercelExpress29.717s (-13.9% 🟢)31.535s (-14.3% 🟢)1.818s31.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.867s4.010s0.143s301.00x
🐘 PostgresExpress4.012s (+0.5%)4.493s (+2.8%)0.482s271.04x
💻 LocalNext.js (Turbopack)8.486s9.017s0.531s142.19x
💻 LocalExpress9.064s (-1.6%)9.478s (-5.4% 🟢)0.414s132.34x
💻 LocalNitro9.278s (~)9.942s (-0.8%)0.664s132.40x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro71.447s (-26.3% 🟢)73.075s (-25.8% 🟢)1.628s21.00x
▲ VercelExpress72.056s (-44.6% 🟢)73.881s (-44.1% 🟢)1.825s21.01x
▲ VercelNext.js (Turbopack)74.567s (-30.4% 🟢)76.256s (-30.0% 🟢)1.690s21.04x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.249s1.007s0.758s601.00x
🐘 PostgresExpress0.289s (+2.3%)1.007s (~)0.718s601.16x
💻 LocalNext.js (Turbopack)0.544s1.004s0.461s602.19x
💻 LocalNitro0.592s (-2.1%)1.022s (~)0.430s592.38x
💻 LocalExpress0.604s (+7.8% 🔺)1.021s (+1.7%)0.417s592.43x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.416s (-27.6% 🟢)2.982s (-18.0% 🟢)1.567s211.00x
▲ VercelNitro1.604s (-3.4%)2.969s (-11.4% 🟢)1.365s211.13x
▲ VercelNext.js (Turbopack)1.608s (-20.5% 🟢)3.112s (-18.0% 🟢)1.504s201.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s1.006s0.520s901.00x
🐘 PostgresExpress0.501s (-1.7%)1.007s (~)0.506s901.03x
💻 LocalExpress2.376s (-5.5% 🟢)3.008s (~)0.632s304.89x
💻 LocalNext.js (Turbopack)2.525s3.009s0.484s305.20x
💻 LocalNitro2.585s (+1.9%)3.009s (~)0.424s305.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.851s (-11.6% 🟢)4.168s (-13.5% 🟢)1.317s221.00x
▲ VercelExpress2.858s (-6.2% 🟢)4.555s (-5.2% 🟢)1.697s201.00x
▲ VercelNext.js (Turbopack)3.341s (-5.5% 🟢)4.972s (-4.3%)1.631s191.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.781s1.007s0.225s1201.00x
🐘 PostgresExpress0.822s (~)1.010s (-0.7%)0.188s1191.05x
💻 LocalExpress10.571s (-5.5% 🟢)11.027s (-7.7% 🟢)0.456s1113.53x
💻 LocalNext.js (Turbopack)10.643s11.207s0.564s1113.63x
💻 LocalNitro11.261s (+0.6%)11.848s (+1.6%)0.587s1114.42x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.395s (-28.4% 🟢)9.144s (-25.6% 🟢)1.748s141.00x
▲ VercelExpress7.507s (+1.2%)9.507s (+2.8%)2.000s131.02x
▲ VercelNitro7.762s (+0.5%)9.268s (-1.4%)1.505s131.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.169s1.003s0.012s1.018s0.848s101.00x
🐘 PostgresExpress0.203s (-1.0%)1.000s (~)0.002s (-6.3% 🟢)1.010s (~)0.807s101.20x
💻 LocalNitro0.204s (-4.6%)1.004s (~)0.011s (-9.6% 🟢)1.018s (~)0.814s101.21x
🐘 PostgresNext.js (Turbopack)0.204s1.001s0.001s1.011s0.806s101.21x
💻 LocalExpress0.227s (+14.2% 🔺)1.004s (~)0.010s (-18.2% 🟢)1.016s (~)0.788s101.34x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.495s (-78.2% 🟢)2.793s (-67.7% 🟢)0.933s (+47.7% 🔺)4.135s (-57.8% 🟢)2.641s101.00x
▲ VercelExpress1.627s (-35.1% 🟢)3.231s (-21.0% 🟢)0.668s (-30.5% 🟢)4.341s (-22.3% 🟢)2.715s101.09x
▲ VercelNitro1.672s (-56.4% 🟢)2.805s (-46.8% 🟢)1.109s (+49.4% 🔺)4.338s (-33.1% 🟢)2.665s101.12x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.609s1.009s0.005s1.022s0.413s591.00x
🐘 PostgresExpress0.632s (~)1.021s (+1.4%)0.004s (+4.4%)1.042s (+1.8%)0.410s581.04x
💻 LocalNext.js (Turbopack)0.756s1.011s0.010s1.117s0.361s541.24x
💻 LocalNitro0.769s (-8.3% 🟢)1.012s (~)0.012s (+25.4% 🔺)1.026s (-8.1% 🟢)0.257s591.26x
💻 LocalExpress0.857s (+13.1% 🔺)1.012s (-1.7%)0.012s (+22.4% 🔺)1.118s (+7.5% 🔺)0.262s541.41x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.777s (-11.2% 🟢)7.473s (-6.7% 🟢)0.185s (-54.8% 🟢)8.112s (-8.2% 🟢)2.335s81.00x
▲ VercelNext.js (Turbopack)6.719s (-60.3% 🟢)8.047s (-55.9% 🟢)0.186s (-11.8% 🟢)8.612s (-54.5% 🟢)1.892s71.16x
▲ VercelNitro8.246s (-72.0% 🟢)9.624s (-68.8% 🟢)0.167s (+48.7% 🔺)10.158s (-68.0% 🟢)1.912s61.43x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.919s1.072s0.000s1.080s0.161s561.00x
🐘 PostgresExpress0.984s (+2.4%)1.301s (+1.8%)0.000s (~)1.328s (+1.7%)0.344s461.07x
💻 LocalExpress1.238s (+1.0%)2.020s (~)0.000s (+30.0% 🔺)2.022s (~)0.785s301.35x
💻 LocalNext.js (Turbopack)1.241s2.019s0.000s2.022s0.781s301.35x
💻 LocalNitro1.433s (+17.2% 🔺)2.023s (~)0.000s (+292.9% 🔺)2.204s (+9.0% 🔺)0.771s281.56x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.869s (-6.0% 🟢)4.073s (-7.3% 🟢)0.000s (-7.1% 🟢)4.417s (-8.2% 🟢)1.548s141.00x
▲ VercelExpress2.934s (-21.6% 🟢)4.316s (-15.4% 🟢)0.000s (-100.0% 🟢)4.733s (-14.4% 🟢)1.799s131.02x
▲ VercelNext.js (Turbopack)3.017s (-70.4% 🟢)4.293s (-62.7% 🟢)0.000s (+Infinity% 🔺)4.672s (-61.2% 🟢)1.655s141.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.793s (+1.2%)2.143s (-1.6%)0.000s (+Infinity% 🔺)2.152s (-2.1%)0.359s281.00x
🐘 PostgresNext.js (Turbopack)1.844s2.145s0.000s2.152s0.308s281.03x
💻 LocalNext.js (Turbopack)3.508s4.033s0.000s4.036s0.528s151.96x
💻 LocalExpress3.603s (+3.9%)4.101s (+1.7%)0.001s (-8.3% 🟢)4.105s (+1.7%)0.502s152.01x
💻 LocalNitro3.674s (+8.5% 🔺)4.164s (+3.3%)0.001s (~)4.167s (+3.2%)0.493s152.05x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.063s (-0.8%)5.253s (-2.2%)0.000s (-100.0% 🟢)5.588s (-3.5%)1.526s111.00x
▲ VercelExpress4.167s (-9.2% 🟢)5.682s (-5.6% 🟢)0.000s (NaN%)6.087s (-5.7% 🟢)1.920s111.03x
▲ VercelNext.js (Turbopack)4.455s (-20.7% 🟢)5.836s (-16.4% 🟢)0.000s (-100.0% 🟢)6.230s (-17.4% 🟢)1.774s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)14/21
🐘 PostgresNext.js (Turbopack)12/21
▲ VercelExpress9/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres16/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro💻 Local16/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)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

Comment thread.changeset/stream-cancel-propagation-main.md Outdated
Comment threadpackages/world-vercel/src/streamer.ts Outdated
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, well-scoped fix. Forward-port of #1801 for main. The approach — cancelled flag as the source of truth plus a single shared AbortController for the whole stream lifetime — is the right pattern for this class of bug.

What looks good

  • Cancellation checks at all the right points: before reader.read(), after reader.read() (covers the case where read completed naturally between abort and flag check), and before reconnect(). Combined with the AbortController plumbed into fetch, this covers all the race windows:

    • Cancel before any pull → initial reader gets cancelled, pull is never invoked
    • Cancel during active read → AbortError swallowed, exits cleanly
    • Cancel during reconnect → in-flight fetch aborted, caught, exits cleanly
    • Cancel between reconnect completion and next read → flag checked at top of loop
  • Shared AbortController across all reconnects is correct. Once aborted, it stays aborted, which means all future connect() calls abort instantly. Right primitive for whole-stream cancellation.

  • Reconnect try/catch properly distinguishes abort-from-cancel (return silently) vs. real errors (propagate via controller.error).

  • reader.cancel().catch() on the closure variable — the comment explicitly acknowledges the TOCTOU window and explains why the cancelled flag is the real guarantee. Good defense-in-depth comment.

  • Changeset correctly scoped to @workflow/world-vercel only.

Test coverage observations

The PR description calls out test 1 (aborts the in-flight upstream fetch via AbortSignal) as failing on main without the fix — I agree, that's the strongest test.

Tests 2 and 3 are more like documentation/regression guards than fix verifications:

  • Test 2 (does not reconnect after the consumer cancels mid-timeout): the test never calls read() after the first one, so pull is never re-invoked — no reconnect path is actually exercised. Pre-fix, fetchCount would also be 1 simply because there's no trigger for a second pull. To really exercise the race, the test would need to let pull enter the reconnect branch before cancel (e.g. drain all data + timeout frame before cancelling). That said, it's still useful as a guard against future regressions where someone might trigger reconnects asynchronously.
  • Test 3 (cancels the active reader when cancel is called during a read): WHATWG streams semantics already make reader.cancel() propagate to the upstream body reader, so this likely passed pre-fix too.

Not blocking — the primary fix is well-verified by test 1.

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

@VaguelySerious@TooTallNate
, '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('^' + ".*" + ' [world-vercel] Propagate cancel from streams.get to upstream fetch by VaguelySerious · Pull Request #1802 · vercel/workflow · GitHub
Skip to content

[world-vercel] Propagate cancel from streams.get to upstream fetch - #1802

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main
Closed

[world-vercel] Propagate cancel from streams.get to upstream fetch#1802
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

Forward-port of #1801 onto main. Same class of bug, different function shape (streams.get(runId, name, startIndex) here vs. readFromStream(name, startIndex) on stable).

When a consumer cancels the ReadableStream returned by streams.get() (e.g. an HTTP client disconnects from an API route that pipes run.getReadable()), the pull loop in the streamer kept running and could trigger further reconnects in the background. The in-flight upstream fetch was never aborted, so the endpoint kept fetching long after the client had gone away.

Root cause

  1. No cancelled flag — pull had no way to know the consumer asked to stop.
  2. No AbortSignal on the upstream fetch() — even if we noticed, there was no way to unblock a pending request.

The cancel handler only called reader.cancel() on whichever reader was captured at that moment. If pull was mid-reconnect (reader = await connect()), cancel cancelled the stale reader; the new fetch then connected and kept streaming.

Fix

  • Track a cancelled flag that pull checks before and after each reader.read() and before each connect().
  • Plumb an AbortController.signal into fetch, aborted from cancel, so the in-flight request (including a pending reconnect) unblocks.
  • connect() failures triggered by abort are swallowed silently when cancelled.

Tests

Three new tests under a new streams.get consumer cancel describe block:

  • aborts the in-flight upstream fetch via AbortSignal — fails on main without the fix; asserts fetch was called with an AbortSignal and that the signal is aborted after stream.cancel().
  • does not reconnect after the consumer cancels mid-timeout — documents that no further fetch is initiated after cancel.
  • cancels the active reader when cancel is called during a read — documents that cancel unblocks a pending reader.read().

All 32 world-vercel streamer tests pass locally.

Companion

Test plan

  • pnpm vitest run — all world-vercel tests pass
  • Typecheck clean
  • CI + workflow-server auto e2e

🤖 Generated with Claude Code

When a consumer cancels the ReadableStream returned by streams.get
(e.g. an HTTP client hanging up on an endpoint that pipes
`run.getReadable()`), the pull loop could continue running and even
trigger a fresh reconnect via `connect()` — the new fetch was never
tied to the cancellation, so the request kept running in the
background.
Fix:
- Track a `cancelled` flag that `pull` checks before and after each
read and before each reconnect.
- Plumb an `AbortController.signal` into `fetch` so the in-flight
upstream request (including a pending reconnect) is aborted when
the consumer cancels.
Regression tests cover the abort-signal contract, the mid-timeout
reconnect race, and cancel-during-read.
Port of #1801 (targeting `stable`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9de9271

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

This PR includes changesets to release 18 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/aiPatch
@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 Apr 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9450671012
❌ 💻 Local Development10171861104
✅ 📦 Local Production10180861104
✅ 🐘 Local Postgres10180861104
✅ 📋 Other258018276
Total425613434600

❌ Failed Tests

💻 Local Development (1 failed)

vite-stable (1 failed):

  • hookWorkflow | wrun_01KPEF76M376DM0WQEFASYBKMY

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8507
✅ example8507
✅ express8507
✅ fastify8507
✅ hono8507
✅ nextjs-turbopack9002
✅ nextjs-webpack9002
✅ nitro8507
✅ nuxt8507
✅ sveltekit8507
✅ vite8507
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
❌ vite-stable8516
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8606
✅ e2e-local-postgres-nest-stable8606
✅ e2e-local-prod-nest-stable8606

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 17, 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.044s (+1.4%)1.005s (~)0.962s101.00x
💻 LocalExpress0.044s (-0.9%)1.005s (~)0.961s101.00x
💻 LocalNext.js (Turbopack)0.048s1.005s0.957s101.09x
🐘 PostgresExpress0.057s (-2.1%)1.011s (~)0.955s101.30x
🐘 PostgresNext.js (Turbopack)0.058s1.009s0.951s101.33x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.215s (-8.6% 🟢)1.900s (-11.0% 🟢)1.685s101.00x
▲ VercelNitro0.254s (-38.0% 🟢)1.794s (-28.5% 🟢)1.540s101.18x
▲ VercelNext.js (Turbopack)0.264s (+5.1% 🔺)2.153s (-7.7% 🟢)1.889s101.23x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.123s2.005s0.882s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.878s101.00x
💻 LocalExpress1.129s (~)2.005s (~)0.876s101.00x
🐘 PostgresNext.js (Turbopack)1.139s2.009s0.870s101.01x
🐘 PostgresExpress1.153s (+0.5%)2.010s (~)0.857s101.03x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.945s (+3.7%)3.789s (~)1.844s101.00x
▲ VercelNext.js (Turbopack)2.087s (+2.5%)3.450s (-9.9% 🟢)1.363s101.07x
▲ VercelNitro2.112s (-45.7% 🟢)3.337s (-43.5% 🟢)1.225s101.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.778s11.022s0.245s31.00x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.01x
💻 LocalExpress10.927s (~)11.023s (~)0.097s31.01x
🐘 PostgresNext.js (Turbopack)10.939s11.020s0.082s31.01x
💻 LocalNitro10.942s (~)11.023s (~)0.081s31.02x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)19.107s (+10.3% 🔺)20.648s (+6.4% 🔺)1.542s21.00x
▲ VercelExpress20.625s (+21.5% 🔺)22.950s (+14.6% 🔺)2.326s21.08x
▲ VercelNitro22.424s (-5.5% 🟢)24.009s (-4.4%)1.585s21.17x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.499s15.020s0.520s41.00x
💻 LocalNext.js (Turbopack)14.627s15.029s0.402s41.01x
🐘 PostgresExpress14.633s (~)15.025s (~)0.392s41.01x
💻 LocalNitro14.994s (~)15.280s (-4.7%)0.286s41.03x
💻 LocalExpress15.033s (~)15.280s (+1.7%)0.247s41.04x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.730s (-36.9% 🟢)33.288s (-36.7% 🟢)1.558s21.00x
▲ VercelNitro32.513s (-49.6% 🟢)33.549s (-49.6% 🟢)1.037s21.02x
▲ VercelNext.js (Turbopack)34.645s (-34.1% 🟢)36.196s (-33.7% 🟢)1.551s21.09x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.972s (~)14.310s (-1.9%)0.338s71.00x
🐘 PostgresNext.js (Turbopack)13.996s14.306s0.310s71.00x
💻 LocalNext.js (Turbopack)16.008s16.363s0.354s61.15x
💻 LocalNitro16.765s (~)17.031s (~)0.266s61.20x
💻 LocalExpress16.821s (+1.3%)17.199s (+1.0%)0.378s61.20x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express55.760s (-54.0% 🟢)57.850s (-53.2% 🟢)2.090s21.00x
▲ VercelNext.js (Turbopack)58.773s (-85.1% 🟢)60.892s (-84.6% 🟢)2.119s21.05x
▲ VercelNitro58.992s (-86.1% 🟢)59.843s (-85.9% 🟢)0.852s21.06x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.237s2.009s0.771s151.00x
🐘 PostgresExpress1.271s (+0.8%)2.010s (~)0.739s151.03x
💻 LocalNext.js (Turbopack)1.565s2.073s0.508s151.26x
💻 LocalNitro1.569s (-3.8%)2.006s (-3.3%)0.438s151.27x
💻 LocalExpress1.591s (+6.9% 🔺)2.072s (+3.3%)0.481s151.29x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.177s (-23.9% 🟢)3.957s (-14.4% 🟢)1.780s81.00x
▲ VercelNitro2.266s (-19.6% 🟢)3.575s (-17.3% 🟢)1.309s91.04x
▲ VercelNext.js (Turbopack)2.491s (-26.7% 🟢)3.966s (-19.6% 🟢)1.475s81.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.326s (-1.5%)3.008s (~)0.682s101.00x
🐘 PostgresNext.js (Turbopack)2.414s3.009s0.595s101.04x
💻 LocalExpress2.853s (-3.4%)3.209s (-7.1% 🟢)0.355s101.23x
💻 LocalNext.js (Turbopack)2.870s3.109s0.239s101.23x
💻 LocalNitro3.075s (-2.2%)3.676s (-5.4% 🟢)0.602s91.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.427s (-40.1% 🟢)3.659s (-38.2% 🟢)1.232s91.00x
▲ VercelExpress2.597s (-28.2% 🟢)3.934s (-23.0% 🟢)1.337s81.07x
▲ VercelNext.js (Turbopack)2.605s (-63.3% 🟢)4.047s (-54.6% 🟢)1.442s81.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.487s (~)4.009s (~)0.522s81.00x
🐘 PostgresNext.js (Turbopack)3.660s4.010s0.350s81.05x
💻 LocalNext.js (Turbopack)7.234s7.765s0.532s42.07x
💻 LocalExpress7.298s (-12.5% 🟢)8.019s (-11.2% 🟢)0.721s42.09x
💻 LocalNitro8.550s (+2.4%)9.025s (~)0.475s42.45x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.074s (-12.8% 🟢)4.414s (-20.2% 🟢)1.340s81.00x
▲ VercelExpress3.138s (-26.0% 🟢)5.027s (-18.0% 🟢)1.889s71.02x
▲ VercelNext.js (Turbopack)4.736s (-46.9% 🟢)6.298s (-42.5% 🟢)1.562s51.54x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.235s2.009s0.774s151.00x
🐘 PostgresExpress1.264s (+0.5%)2.007s (~)0.744s151.02x
💻 LocalNext.js (Turbopack)1.508s2.005s0.497s151.22x
💻 LocalExpress1.517s (-19.9% 🟢)2.006s (-15.1% 🟢)0.489s151.23x
💻 LocalNitro1.557s (-16.5% 🟢)2.006s (-14.3% 🟢)0.449s151.26x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.144s (-16.9% 🟢)4.110s (-5.5% 🟢)1.966s81.00x
▲ VercelNext.js (Turbopack)2.156s (-26.5% 🟢)3.524s (-24.1% 🟢)1.368s91.01x
▲ VercelNitro2.427s (-1.3%)3.595s (-13.8% 🟢)1.168s91.13x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.352s (~)3.009s (~)0.657s101.00x
🐘 PostgresNext.js (Turbopack)2.387s3.009s0.622s101.01x
💻 LocalExpress2.940s (-6.1% 🟢)3.341s (-11.2% 🟢)0.401s91.25x
💻 LocalNext.js (Turbopack)2.961s3.760s0.799s81.26x
💻 LocalNitro3.055s (~)3.759s (-3.3%)0.704s81.30x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.296s (-28.1% 🟢)3.931s (-18.0% 🟢)1.635s81.00x
▲ VercelNitro2.679s (-17.1% 🟢)3.957s (-22.1% 🟢)1.277s91.17x
▲ VercelNext.js (Turbopack)2.758s (-12.2% 🟢)4.045s (-10.5% 🟢)1.287s81.20x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.489s (~)4.011s (~)0.521s81.00x
🐘 PostgresNext.js (Turbopack)3.668s4.010s0.341s81.05x
💻 LocalExpress7.974s (-9.4% 🟢)8.524s (-8.1% 🟢)0.549s42.29x
💻 LocalNext.js (Turbopack)8.849s9.524s0.675s42.54x
💻 LocalNitro9.056s (-1.0%)9.523s (-5.0% 🟢)0.467s42.60x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.854s (-44.0% 🟢)4.359s (-36.1% 🟢)1.505s71.00x
▲ VercelExpress2.952s (-54.0% 🟢)4.606s (-43.7% 🟢)1.655s71.03x
▲ VercelNext.js (Turbopack)3.820s (-43.5% 🟢)5.366s (-37.2% 🟢)1.546s61.34x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.778s1.023s0.244s591.00x
🐘 PostgresExpress0.822s (-2.1%)1.006s (-1.6%)0.185s601.06x
💻 LocalNext.js (Turbopack)0.844s1.004s0.160s601.08x
💻 LocalExpress1.013s (+3.0%)1.672s (+55.4% 🔺)0.659s361.30x
💻 LocalNitro1.026s (+4.7%)1.800s (+64.6% 🔺)0.774s341.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)9.041s (-37.7% 🟢)10.605s (-34.1% 🟢)1.564s61.00x
▲ VercelNitro9.167s (-58.4% 🟢)10.774s (-55.2% 🟢)1.608s61.01x
▲ VercelExpress9.420s (-50.5% 🟢)10.934s (-48.7% 🟢)1.514s61.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.908s2.124s0.216s431.00x
🐘 PostgresExpress1.976s (~)2.258s (~)0.282s401.04x
💻 LocalNext.js (Turbopack)2.641s3.007s0.366s301.38x
💻 LocalExpress3.022s (~)3.689s (+2.9%)0.667s251.58x
💻 LocalNitro3.063s (+0.9%)3.922s (+4.4%)0.859s231.61x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)28.897s (-42.0% 🟢)30.300s (-41.4% 🟢)1.404s31.00x
▲ VercelNitro29.540s (-25.2% 🟢)31.066s (-24.8% 🟢)1.525s31.02x
▲ VercelExpress29.717s (-13.9% 🟢)31.535s (-14.3% 🟢)1.818s31.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.867s4.010s0.143s301.00x
🐘 PostgresExpress4.012s (+0.5%)4.493s (+2.8%)0.482s271.04x
💻 LocalNext.js (Turbopack)8.486s9.017s0.531s142.19x
💻 LocalExpress9.064s (-1.6%)9.478s (-5.4% 🟢)0.414s132.34x
💻 LocalNitro9.278s (~)9.942s (-0.8%)0.664s132.40x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro71.447s (-26.3% 🟢)73.075s (-25.8% 🟢)1.628s21.00x
▲ VercelExpress72.056s (-44.6% 🟢)73.881s (-44.1% 🟢)1.825s21.01x
▲ VercelNext.js (Turbopack)74.567s (-30.4% 🟢)76.256s (-30.0% 🟢)1.690s21.04x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.249s1.007s0.758s601.00x
🐘 PostgresExpress0.289s (+2.3%)1.007s (~)0.718s601.16x
💻 LocalNext.js (Turbopack)0.544s1.004s0.461s602.19x
💻 LocalNitro0.592s (-2.1%)1.022s (~)0.430s592.38x
💻 LocalExpress0.604s (+7.8% 🔺)1.021s (+1.7%)0.417s592.43x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.416s (-27.6% 🟢)2.982s (-18.0% 🟢)1.567s211.00x
▲ VercelNitro1.604s (-3.4%)2.969s (-11.4% 🟢)1.365s211.13x
▲ VercelNext.js (Turbopack)1.608s (-20.5% 🟢)3.112s (-18.0% 🟢)1.504s201.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s1.006s0.520s901.00x
🐘 PostgresExpress0.501s (-1.7%)1.007s (~)0.506s901.03x
💻 LocalExpress2.376s (-5.5% 🟢)3.008s (~)0.632s304.89x
💻 LocalNext.js (Turbopack)2.525s3.009s0.484s305.20x
💻 LocalNitro2.585s (+1.9%)3.009s (~)0.424s305.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.851s (-11.6% 🟢)4.168s (-13.5% 🟢)1.317s221.00x
▲ VercelExpress2.858s (-6.2% 🟢)4.555s (-5.2% 🟢)1.697s201.00x
▲ VercelNext.js (Turbopack)3.341s (-5.5% 🟢)4.972s (-4.3%)1.631s191.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.781s1.007s0.225s1201.00x
🐘 PostgresExpress0.822s (~)1.010s (-0.7%)0.188s1191.05x
💻 LocalExpress10.571s (-5.5% 🟢)11.027s (-7.7% 🟢)0.456s1113.53x
💻 LocalNext.js (Turbopack)10.643s11.207s0.564s1113.63x
💻 LocalNitro11.261s (+0.6%)11.848s (+1.6%)0.587s1114.42x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.395s (-28.4% 🟢)9.144s (-25.6% 🟢)1.748s141.00x
▲ VercelExpress7.507s (+1.2%)9.507s (+2.8%)2.000s131.02x
▲ VercelNitro7.762s (+0.5%)9.268s (-1.4%)1.505s131.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.169s1.003s0.012s1.018s0.848s101.00x
🐘 PostgresExpress0.203s (-1.0%)1.000s (~)0.002s (-6.3% 🟢)1.010s (~)0.807s101.20x
💻 LocalNitro0.204s (-4.6%)1.004s (~)0.011s (-9.6% 🟢)1.018s (~)0.814s101.21x
🐘 PostgresNext.js (Turbopack)0.204s1.001s0.001s1.011s0.806s101.21x
💻 LocalExpress0.227s (+14.2% 🔺)1.004s (~)0.010s (-18.2% 🟢)1.016s (~)0.788s101.34x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.495s (-78.2% 🟢)2.793s (-67.7% 🟢)0.933s (+47.7% 🔺)4.135s (-57.8% 🟢)2.641s101.00x
▲ VercelExpress1.627s (-35.1% 🟢)3.231s (-21.0% 🟢)0.668s (-30.5% 🟢)4.341s (-22.3% 🟢)2.715s101.09x
▲ VercelNitro1.672s (-56.4% 🟢)2.805s (-46.8% 🟢)1.109s (+49.4% 🔺)4.338s (-33.1% 🟢)2.665s101.12x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.609s1.009s0.005s1.022s0.413s591.00x
🐘 PostgresExpress0.632s (~)1.021s (+1.4%)0.004s (+4.4%)1.042s (+1.8%)0.410s581.04x
💻 LocalNext.js (Turbopack)0.756s1.011s0.010s1.117s0.361s541.24x
💻 LocalNitro0.769s (-8.3% 🟢)1.012s (~)0.012s (+25.4% 🔺)1.026s (-8.1% 🟢)0.257s591.26x
💻 LocalExpress0.857s (+13.1% 🔺)1.012s (-1.7%)0.012s (+22.4% 🔺)1.118s (+7.5% 🔺)0.262s541.41x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.777s (-11.2% 🟢)7.473s (-6.7% 🟢)0.185s (-54.8% 🟢)8.112s (-8.2% 🟢)2.335s81.00x
▲ VercelNext.js (Turbopack)6.719s (-60.3% 🟢)8.047s (-55.9% 🟢)0.186s (-11.8% 🟢)8.612s (-54.5% 🟢)1.892s71.16x
▲ VercelNitro8.246s (-72.0% 🟢)9.624s (-68.8% 🟢)0.167s (+48.7% 🔺)10.158s (-68.0% 🟢)1.912s61.43x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.919s1.072s0.000s1.080s0.161s561.00x
🐘 PostgresExpress0.984s (+2.4%)1.301s (+1.8%)0.000s (~)1.328s (+1.7%)0.344s461.07x
💻 LocalExpress1.238s (+1.0%)2.020s (~)0.000s (+30.0% 🔺)2.022s (~)0.785s301.35x
💻 LocalNext.js (Turbopack)1.241s2.019s0.000s2.022s0.781s301.35x
💻 LocalNitro1.433s (+17.2% 🔺)2.023s (~)0.000s (+292.9% 🔺)2.204s (+9.0% 🔺)0.771s281.56x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.869s (-6.0% 🟢)4.073s (-7.3% 🟢)0.000s (-7.1% 🟢)4.417s (-8.2% 🟢)1.548s141.00x
▲ VercelExpress2.934s (-21.6% 🟢)4.316s (-15.4% 🟢)0.000s (-100.0% 🟢)4.733s (-14.4% 🟢)1.799s131.02x
▲ VercelNext.js (Turbopack)3.017s (-70.4% 🟢)4.293s (-62.7% 🟢)0.000s (+Infinity% 🔺)4.672s (-61.2% 🟢)1.655s141.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.793s (+1.2%)2.143s (-1.6%)0.000s (+Infinity% 🔺)2.152s (-2.1%)0.359s281.00x
🐘 PostgresNext.js (Turbopack)1.844s2.145s0.000s2.152s0.308s281.03x
💻 LocalNext.js (Turbopack)3.508s4.033s0.000s4.036s0.528s151.96x
💻 LocalExpress3.603s (+3.9%)4.101s (+1.7%)0.001s (-8.3% 🟢)4.105s (+1.7%)0.502s152.01x
💻 LocalNitro3.674s (+8.5% 🔺)4.164s (+3.3%)0.001s (~)4.167s (+3.2%)0.493s152.05x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.063s (-0.8%)5.253s (-2.2%)0.000s (-100.0% 🟢)5.588s (-3.5%)1.526s111.00x
▲ VercelExpress4.167s (-9.2% 🟢)5.682s (-5.6% 🟢)0.000s (NaN%)6.087s (-5.7% 🟢)1.920s111.03x
▲ VercelNext.js (Turbopack)4.455s (-20.7% 🟢)5.836s (-16.4% 🟢)0.000s (-100.0% 🟢)6.230s (-17.4% 🟢)1.774s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)14/21
🐘 PostgresNext.js (Turbopack)12/21
▲ VercelExpress9/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres16/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro💻 Local16/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)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

Comment thread.changeset/stream-cancel-propagation-main.md Outdated
Comment threadpackages/world-vercel/src/streamer.ts Outdated
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, well-scoped fix. Forward-port of #1801 for main. The approach — cancelled flag as the source of truth plus a single shared AbortController for the whole stream lifetime — is the right pattern for this class of bug.

What looks good

  • Cancellation checks at all the right points: before reader.read(), after reader.read() (covers the case where read completed naturally between abort and flag check), and before reconnect(). Combined with the AbortController plumbed into fetch, this covers all the race windows:

    • Cancel before any pull → initial reader gets cancelled, pull is never invoked
    • Cancel during active read → AbortError swallowed, exits cleanly
    • Cancel during reconnect → in-flight fetch aborted, caught, exits cleanly
    • Cancel between reconnect completion and next read → flag checked at top of loop
  • Shared AbortController across all reconnects is correct. Once aborted, it stays aborted, which means all future connect() calls abort instantly. Right primitive for whole-stream cancellation.

  • Reconnect try/catch properly distinguishes abort-from-cancel (return silently) vs. real errors (propagate via controller.error).

  • reader.cancel().catch() on the closure variable — the comment explicitly acknowledges the TOCTOU window and explains why the cancelled flag is the real guarantee. Good defense-in-depth comment.

  • Changeset correctly scoped to @workflow/world-vercel only.

Test coverage observations

The PR description calls out test 1 (aborts the in-flight upstream fetch via AbortSignal) as failing on main without the fix — I agree, that's the strongest test.

Tests 2 and 3 are more like documentation/regression guards than fix verifications:

  • Test 2 (does not reconnect after the consumer cancels mid-timeout): the test never calls read() after the first one, so pull is never re-invoked — no reconnect path is actually exercised. Pre-fix, fetchCount would also be 1 simply because there's no trigger for a second pull. To really exercise the race, the test would need to let pull enter the reconnect branch before cancel (e.g. drain all data + timeout frame before cancelling). That said, it's still useful as a guard against future regressions where someone might trigger reconnects asynchronously.
  • Test 3 (cancels the active reader when cancel is called during a read): WHATWG streams semantics already make reader.cancel() propagate to the upstream body reader, so this likely passed pre-fix too.

Not blocking — the primary fix is well-verified by test 1.

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

@VaguelySerious@TooTallNate
, '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('^' + ".*" + ' [world-vercel] Propagate cancel from streams.get to upstream fetch by VaguelySerious · Pull Request #1802 · vercel/workflow · GitHub
Skip to content

[world-vercel] Propagate cancel from streams.get to upstream fetch - #1802

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main
Closed

[world-vercel] Propagate cancel from streams.get to upstream fetch#1802
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

Forward-port of #1801 onto main. Same class of bug, different function shape (streams.get(runId, name, startIndex) here vs. readFromStream(name, startIndex) on stable).

When a consumer cancels the ReadableStream returned by streams.get() (e.g. an HTTP client disconnects from an API route that pipes run.getReadable()), the pull loop in the streamer kept running and could trigger further reconnects in the background. The in-flight upstream fetch was never aborted, so the endpoint kept fetching long after the client had gone away.

Root cause

  1. No cancelled flag — pull had no way to know the consumer asked to stop.
  2. No AbortSignal on the upstream fetch() — even if we noticed, there was no way to unblock a pending request.

The cancel handler only called reader.cancel() on whichever reader was captured at that moment. If pull was mid-reconnect (reader = await connect()), cancel cancelled the stale reader; the new fetch then connected and kept streaming.

Fix

  • Track a cancelled flag that pull checks before and after each reader.read() and before each connect().
  • Plumb an AbortController.signal into fetch, aborted from cancel, so the in-flight request (including a pending reconnect) unblocks.
  • connect() failures triggered by abort are swallowed silently when cancelled.

Tests

Three new tests under a new streams.get consumer cancel describe block:

  • aborts the in-flight upstream fetch via AbortSignal — fails on main without the fix; asserts fetch was called with an AbortSignal and that the signal is aborted after stream.cancel().
  • does not reconnect after the consumer cancels mid-timeout — documents that no further fetch is initiated after cancel.
  • cancels the active reader when cancel is called during a read — documents that cancel unblocks a pending reader.read().

All 32 world-vercel streamer tests pass locally.

Companion

Test plan

  • pnpm vitest run — all world-vercel tests pass
  • Typecheck clean
  • CI + workflow-server auto e2e

🤖 Generated with Claude Code

When a consumer cancels the ReadableStream returned by streams.get
(e.g. an HTTP client hanging up on an endpoint that pipes
`run.getReadable()`), the pull loop could continue running and even
trigger a fresh reconnect via `connect()` — the new fetch was never
tied to the cancellation, so the request kept running in the
background.
Fix:
- Track a `cancelled` flag that `pull` checks before and after each
read and before each reconnect.
- Plumb an `AbortController.signal` into `fetch` so the in-flight
upstream request (including a pending reconnect) is aborted when
the consumer cancels.
Regression tests cover the abort-signal contract, the mid-timeout
reconnect race, and cancel-during-read.
Port of #1801 (targeting `stable`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9de9271

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

This PR includes changesets to release 18 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/aiPatch
@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 Apr 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9450671012
❌ 💻 Local Development10171861104
✅ 📦 Local Production10180861104
✅ 🐘 Local Postgres10180861104
✅ 📋 Other258018276
Total425613434600

❌ Failed Tests

💻 Local Development (1 failed)

vite-stable (1 failed):

  • hookWorkflow | wrun_01KPEF76M376DM0WQEFASYBKMY

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8507
✅ example8507
✅ express8507
✅ fastify8507
✅ hono8507
✅ nextjs-turbopack9002
✅ nextjs-webpack9002
✅ nitro8507
✅ nuxt8507
✅ sveltekit8507
✅ vite8507
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
❌ vite-stable8516
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8606
✅ e2e-local-postgres-nest-stable8606
✅ e2e-local-prod-nest-stable8606

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 17, 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.044s (+1.4%)1.005s (~)0.962s101.00x
💻 LocalExpress0.044s (-0.9%)1.005s (~)0.961s101.00x
💻 LocalNext.js (Turbopack)0.048s1.005s0.957s101.09x
🐘 PostgresExpress0.057s (-2.1%)1.011s (~)0.955s101.30x
🐘 PostgresNext.js (Turbopack)0.058s1.009s0.951s101.33x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.215s (-8.6% 🟢)1.900s (-11.0% 🟢)1.685s101.00x
▲ VercelNitro0.254s (-38.0% 🟢)1.794s (-28.5% 🟢)1.540s101.18x
▲ VercelNext.js (Turbopack)0.264s (+5.1% 🔺)2.153s (-7.7% 🟢)1.889s101.23x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.123s2.005s0.882s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.878s101.00x
💻 LocalExpress1.129s (~)2.005s (~)0.876s101.00x
🐘 PostgresNext.js (Turbopack)1.139s2.009s0.870s101.01x
🐘 PostgresExpress1.153s (+0.5%)2.010s (~)0.857s101.03x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.945s (+3.7%)3.789s (~)1.844s101.00x
▲ VercelNext.js (Turbopack)2.087s (+2.5%)3.450s (-9.9% 🟢)1.363s101.07x
▲ VercelNitro2.112s (-45.7% 🟢)3.337s (-43.5% 🟢)1.225s101.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.778s11.022s0.245s31.00x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.01x
💻 LocalExpress10.927s (~)11.023s (~)0.097s31.01x
🐘 PostgresNext.js (Turbopack)10.939s11.020s0.082s31.01x
💻 LocalNitro10.942s (~)11.023s (~)0.081s31.02x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)19.107s (+10.3% 🔺)20.648s (+6.4% 🔺)1.542s21.00x
▲ VercelExpress20.625s (+21.5% 🔺)22.950s (+14.6% 🔺)2.326s21.08x
▲ VercelNitro22.424s (-5.5% 🟢)24.009s (-4.4%)1.585s21.17x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.499s15.020s0.520s41.00x
💻 LocalNext.js (Turbopack)14.627s15.029s0.402s41.01x
🐘 PostgresExpress14.633s (~)15.025s (~)0.392s41.01x
💻 LocalNitro14.994s (~)15.280s (-4.7%)0.286s41.03x
💻 LocalExpress15.033s (~)15.280s (+1.7%)0.247s41.04x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.730s (-36.9% 🟢)33.288s (-36.7% 🟢)1.558s21.00x
▲ VercelNitro32.513s (-49.6% 🟢)33.549s (-49.6% 🟢)1.037s21.02x
▲ VercelNext.js (Turbopack)34.645s (-34.1% 🟢)36.196s (-33.7% 🟢)1.551s21.09x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.972s (~)14.310s (-1.9%)0.338s71.00x
🐘 PostgresNext.js (Turbopack)13.996s14.306s0.310s71.00x
💻 LocalNext.js (Turbopack)16.008s16.363s0.354s61.15x
💻 LocalNitro16.765s (~)17.031s (~)0.266s61.20x
💻 LocalExpress16.821s (+1.3%)17.199s (+1.0%)0.378s61.20x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express55.760s (-54.0% 🟢)57.850s (-53.2% 🟢)2.090s21.00x
▲ VercelNext.js (Turbopack)58.773s (-85.1% 🟢)60.892s (-84.6% 🟢)2.119s21.05x
▲ VercelNitro58.992s (-86.1% 🟢)59.843s (-85.9% 🟢)0.852s21.06x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.237s2.009s0.771s151.00x
🐘 PostgresExpress1.271s (+0.8%)2.010s (~)0.739s151.03x
💻 LocalNext.js (Turbopack)1.565s2.073s0.508s151.26x
💻 LocalNitro1.569s (-3.8%)2.006s (-3.3%)0.438s151.27x
💻 LocalExpress1.591s (+6.9% 🔺)2.072s (+3.3%)0.481s151.29x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.177s (-23.9% 🟢)3.957s (-14.4% 🟢)1.780s81.00x
▲ VercelNitro2.266s (-19.6% 🟢)3.575s (-17.3% 🟢)1.309s91.04x
▲ VercelNext.js (Turbopack)2.491s (-26.7% 🟢)3.966s (-19.6% 🟢)1.475s81.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.326s (-1.5%)3.008s (~)0.682s101.00x
🐘 PostgresNext.js (Turbopack)2.414s3.009s0.595s101.04x
💻 LocalExpress2.853s (-3.4%)3.209s (-7.1% 🟢)0.355s101.23x
💻 LocalNext.js (Turbopack)2.870s3.109s0.239s101.23x
💻 LocalNitro3.075s (-2.2%)3.676s (-5.4% 🟢)0.602s91.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.427s (-40.1% 🟢)3.659s (-38.2% 🟢)1.232s91.00x
▲ VercelExpress2.597s (-28.2% 🟢)3.934s (-23.0% 🟢)1.337s81.07x
▲ VercelNext.js (Turbopack)2.605s (-63.3% 🟢)4.047s (-54.6% 🟢)1.442s81.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.487s (~)4.009s (~)0.522s81.00x
🐘 PostgresNext.js (Turbopack)3.660s4.010s0.350s81.05x
💻 LocalNext.js (Turbopack)7.234s7.765s0.532s42.07x
💻 LocalExpress7.298s (-12.5% 🟢)8.019s (-11.2% 🟢)0.721s42.09x
💻 LocalNitro8.550s (+2.4%)9.025s (~)0.475s42.45x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.074s (-12.8% 🟢)4.414s (-20.2% 🟢)1.340s81.00x
▲ VercelExpress3.138s (-26.0% 🟢)5.027s (-18.0% 🟢)1.889s71.02x
▲ VercelNext.js (Turbopack)4.736s (-46.9% 🟢)6.298s (-42.5% 🟢)1.562s51.54x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.235s2.009s0.774s151.00x
🐘 PostgresExpress1.264s (+0.5%)2.007s (~)0.744s151.02x
💻 LocalNext.js (Turbopack)1.508s2.005s0.497s151.22x
💻 LocalExpress1.517s (-19.9% 🟢)2.006s (-15.1% 🟢)0.489s151.23x
💻 LocalNitro1.557s (-16.5% 🟢)2.006s (-14.3% 🟢)0.449s151.26x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.144s (-16.9% 🟢)4.110s (-5.5% 🟢)1.966s81.00x
▲ VercelNext.js (Turbopack)2.156s (-26.5% 🟢)3.524s (-24.1% 🟢)1.368s91.01x
▲ VercelNitro2.427s (-1.3%)3.595s (-13.8% 🟢)1.168s91.13x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.352s (~)3.009s (~)0.657s101.00x
🐘 PostgresNext.js (Turbopack)2.387s3.009s0.622s101.01x
💻 LocalExpress2.940s (-6.1% 🟢)3.341s (-11.2% 🟢)0.401s91.25x
💻 LocalNext.js (Turbopack)2.961s3.760s0.799s81.26x
💻 LocalNitro3.055s (~)3.759s (-3.3%)0.704s81.30x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.296s (-28.1% 🟢)3.931s (-18.0% 🟢)1.635s81.00x
▲ VercelNitro2.679s (-17.1% 🟢)3.957s (-22.1% 🟢)1.277s91.17x
▲ VercelNext.js (Turbopack)2.758s (-12.2% 🟢)4.045s (-10.5% 🟢)1.287s81.20x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.489s (~)4.011s (~)0.521s81.00x
🐘 PostgresNext.js (Turbopack)3.668s4.010s0.341s81.05x
💻 LocalExpress7.974s (-9.4% 🟢)8.524s (-8.1% 🟢)0.549s42.29x
💻 LocalNext.js (Turbopack)8.849s9.524s0.675s42.54x
💻 LocalNitro9.056s (-1.0%)9.523s (-5.0% 🟢)0.467s42.60x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.854s (-44.0% 🟢)4.359s (-36.1% 🟢)1.505s71.00x
▲ VercelExpress2.952s (-54.0% 🟢)4.606s (-43.7% 🟢)1.655s71.03x
▲ VercelNext.js (Turbopack)3.820s (-43.5% 🟢)5.366s (-37.2% 🟢)1.546s61.34x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.778s1.023s0.244s591.00x
🐘 PostgresExpress0.822s (-2.1%)1.006s (-1.6%)0.185s601.06x
💻 LocalNext.js (Turbopack)0.844s1.004s0.160s601.08x
💻 LocalExpress1.013s (+3.0%)1.672s (+55.4% 🔺)0.659s361.30x
💻 LocalNitro1.026s (+4.7%)1.800s (+64.6% 🔺)0.774s341.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)9.041s (-37.7% 🟢)10.605s (-34.1% 🟢)1.564s61.00x
▲ VercelNitro9.167s (-58.4% 🟢)10.774s (-55.2% 🟢)1.608s61.01x
▲ VercelExpress9.420s (-50.5% 🟢)10.934s (-48.7% 🟢)1.514s61.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.908s2.124s0.216s431.00x
🐘 PostgresExpress1.976s (~)2.258s (~)0.282s401.04x
💻 LocalNext.js (Turbopack)2.641s3.007s0.366s301.38x
💻 LocalExpress3.022s (~)3.689s (+2.9%)0.667s251.58x
💻 LocalNitro3.063s (+0.9%)3.922s (+4.4%)0.859s231.61x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)28.897s (-42.0% 🟢)30.300s (-41.4% 🟢)1.404s31.00x
▲ VercelNitro29.540s (-25.2% 🟢)31.066s (-24.8% 🟢)1.525s31.02x
▲ VercelExpress29.717s (-13.9% 🟢)31.535s (-14.3% 🟢)1.818s31.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.867s4.010s0.143s301.00x
🐘 PostgresExpress4.012s (+0.5%)4.493s (+2.8%)0.482s271.04x
💻 LocalNext.js (Turbopack)8.486s9.017s0.531s142.19x
💻 LocalExpress9.064s (-1.6%)9.478s (-5.4% 🟢)0.414s132.34x
💻 LocalNitro9.278s (~)9.942s (-0.8%)0.664s132.40x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro71.447s (-26.3% 🟢)73.075s (-25.8% 🟢)1.628s21.00x
▲ VercelExpress72.056s (-44.6% 🟢)73.881s (-44.1% 🟢)1.825s21.01x
▲ VercelNext.js (Turbopack)74.567s (-30.4% 🟢)76.256s (-30.0% 🟢)1.690s21.04x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.249s1.007s0.758s601.00x
🐘 PostgresExpress0.289s (+2.3%)1.007s (~)0.718s601.16x
💻 LocalNext.js (Turbopack)0.544s1.004s0.461s602.19x
💻 LocalNitro0.592s (-2.1%)1.022s (~)0.430s592.38x
💻 LocalExpress0.604s (+7.8% 🔺)1.021s (+1.7%)0.417s592.43x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.416s (-27.6% 🟢)2.982s (-18.0% 🟢)1.567s211.00x
▲ VercelNitro1.604s (-3.4%)2.969s (-11.4% 🟢)1.365s211.13x
▲ VercelNext.js (Turbopack)1.608s (-20.5% 🟢)3.112s (-18.0% 🟢)1.504s201.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s1.006s0.520s901.00x
🐘 PostgresExpress0.501s (-1.7%)1.007s (~)0.506s901.03x
💻 LocalExpress2.376s (-5.5% 🟢)3.008s (~)0.632s304.89x
💻 LocalNext.js (Turbopack)2.525s3.009s0.484s305.20x
💻 LocalNitro2.585s (+1.9%)3.009s (~)0.424s305.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.851s (-11.6% 🟢)4.168s (-13.5% 🟢)1.317s221.00x
▲ VercelExpress2.858s (-6.2% 🟢)4.555s (-5.2% 🟢)1.697s201.00x
▲ VercelNext.js (Turbopack)3.341s (-5.5% 🟢)4.972s (-4.3%)1.631s191.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.781s1.007s0.225s1201.00x
🐘 PostgresExpress0.822s (~)1.010s (-0.7%)0.188s1191.05x
💻 LocalExpress10.571s (-5.5% 🟢)11.027s (-7.7% 🟢)0.456s1113.53x
💻 LocalNext.js (Turbopack)10.643s11.207s0.564s1113.63x
💻 LocalNitro11.261s (+0.6%)11.848s (+1.6%)0.587s1114.42x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.395s (-28.4% 🟢)9.144s (-25.6% 🟢)1.748s141.00x
▲ VercelExpress7.507s (+1.2%)9.507s (+2.8%)2.000s131.02x
▲ VercelNitro7.762s (+0.5%)9.268s (-1.4%)1.505s131.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.169s1.003s0.012s1.018s0.848s101.00x
🐘 PostgresExpress0.203s (-1.0%)1.000s (~)0.002s (-6.3% 🟢)1.010s (~)0.807s101.20x
💻 LocalNitro0.204s (-4.6%)1.004s (~)0.011s (-9.6% 🟢)1.018s (~)0.814s101.21x
🐘 PostgresNext.js (Turbopack)0.204s1.001s0.001s1.011s0.806s101.21x
💻 LocalExpress0.227s (+14.2% 🔺)1.004s (~)0.010s (-18.2% 🟢)1.016s (~)0.788s101.34x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.495s (-78.2% 🟢)2.793s (-67.7% 🟢)0.933s (+47.7% 🔺)4.135s (-57.8% 🟢)2.641s101.00x
▲ VercelExpress1.627s (-35.1% 🟢)3.231s (-21.0% 🟢)0.668s (-30.5% 🟢)4.341s (-22.3% 🟢)2.715s101.09x
▲ VercelNitro1.672s (-56.4% 🟢)2.805s (-46.8% 🟢)1.109s (+49.4% 🔺)4.338s (-33.1% 🟢)2.665s101.12x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.609s1.009s0.005s1.022s0.413s591.00x
🐘 PostgresExpress0.632s (~)1.021s (+1.4%)0.004s (+4.4%)1.042s (+1.8%)0.410s581.04x
💻 LocalNext.js (Turbopack)0.756s1.011s0.010s1.117s0.361s541.24x
💻 LocalNitro0.769s (-8.3% 🟢)1.012s (~)0.012s (+25.4% 🔺)1.026s (-8.1% 🟢)0.257s591.26x
💻 LocalExpress0.857s (+13.1% 🔺)1.012s (-1.7%)0.012s (+22.4% 🔺)1.118s (+7.5% 🔺)0.262s541.41x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.777s (-11.2% 🟢)7.473s (-6.7% 🟢)0.185s (-54.8% 🟢)8.112s (-8.2% 🟢)2.335s81.00x
▲ VercelNext.js (Turbopack)6.719s (-60.3% 🟢)8.047s (-55.9% 🟢)0.186s (-11.8% 🟢)8.612s (-54.5% 🟢)1.892s71.16x
▲ VercelNitro8.246s (-72.0% 🟢)9.624s (-68.8% 🟢)0.167s (+48.7% 🔺)10.158s (-68.0% 🟢)1.912s61.43x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.919s1.072s0.000s1.080s0.161s561.00x
🐘 PostgresExpress0.984s (+2.4%)1.301s (+1.8%)0.000s (~)1.328s (+1.7%)0.344s461.07x
💻 LocalExpress1.238s (+1.0%)2.020s (~)0.000s (+30.0% 🔺)2.022s (~)0.785s301.35x
💻 LocalNext.js (Turbopack)1.241s2.019s0.000s2.022s0.781s301.35x
💻 LocalNitro1.433s (+17.2% 🔺)2.023s (~)0.000s (+292.9% 🔺)2.204s (+9.0% 🔺)0.771s281.56x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.869s (-6.0% 🟢)4.073s (-7.3% 🟢)0.000s (-7.1% 🟢)4.417s (-8.2% 🟢)1.548s141.00x
▲ VercelExpress2.934s (-21.6% 🟢)4.316s (-15.4% 🟢)0.000s (-100.0% 🟢)4.733s (-14.4% 🟢)1.799s131.02x
▲ VercelNext.js (Turbopack)3.017s (-70.4% 🟢)4.293s (-62.7% 🟢)0.000s (+Infinity% 🔺)4.672s (-61.2% 🟢)1.655s141.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.793s (+1.2%)2.143s (-1.6%)0.000s (+Infinity% 🔺)2.152s (-2.1%)0.359s281.00x
🐘 PostgresNext.js (Turbopack)1.844s2.145s0.000s2.152s0.308s281.03x
💻 LocalNext.js (Turbopack)3.508s4.033s0.000s4.036s0.528s151.96x
💻 LocalExpress3.603s (+3.9%)4.101s (+1.7%)0.001s (-8.3% 🟢)4.105s (+1.7%)0.502s152.01x
💻 LocalNitro3.674s (+8.5% 🔺)4.164s (+3.3%)0.001s (~)4.167s (+3.2%)0.493s152.05x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.063s (-0.8%)5.253s (-2.2%)0.000s (-100.0% 🟢)5.588s (-3.5%)1.526s111.00x
▲ VercelExpress4.167s (-9.2% 🟢)5.682s (-5.6% 🟢)0.000s (NaN%)6.087s (-5.7% 🟢)1.920s111.03x
▲ VercelNext.js (Turbopack)4.455s (-20.7% 🟢)5.836s (-16.4% 🟢)0.000s (-100.0% 🟢)6.230s (-17.4% 🟢)1.774s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)14/21
🐘 PostgresNext.js (Turbopack)12/21
▲ VercelExpress9/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres16/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro💻 Local16/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)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

Comment thread.changeset/stream-cancel-propagation-main.md Outdated
Comment threadpackages/world-vercel/src/streamer.ts Outdated
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, well-scoped fix. Forward-port of #1801 for main. The approach — cancelled flag as the source of truth plus a single shared AbortController for the whole stream lifetime — is the right pattern for this class of bug.

What looks good

  • Cancellation checks at all the right points: before reader.read(), after reader.read() (covers the case where read completed naturally between abort and flag check), and before reconnect(). Combined with the AbortController plumbed into fetch, this covers all the race windows:

    • Cancel before any pull → initial reader gets cancelled, pull is never invoked
    • Cancel during active read → AbortError swallowed, exits cleanly
    • Cancel during reconnect → in-flight fetch aborted, caught, exits cleanly
    • Cancel between reconnect completion and next read → flag checked at top of loop
  • Shared AbortController across all reconnects is correct. Once aborted, it stays aborted, which means all future connect() calls abort instantly. Right primitive for whole-stream cancellation.

  • Reconnect try/catch properly distinguishes abort-from-cancel (return silently) vs. real errors (propagate via controller.error).

  • reader.cancel().catch() on the closure variable — the comment explicitly acknowledges the TOCTOU window and explains why the cancelled flag is the real guarantee. Good defense-in-depth comment.

  • Changeset correctly scoped to @workflow/world-vercel only.

Test coverage observations

The PR description calls out test 1 (aborts the in-flight upstream fetch via AbortSignal) as failing on main without the fix — I agree, that's the strongest test.

Tests 2 and 3 are more like documentation/regression guards than fix verifications:

  • Test 2 (does not reconnect after the consumer cancels mid-timeout): the test never calls read() after the first one, so pull is never re-invoked — no reconnect path is actually exercised. Pre-fix, fetchCount would also be 1 simply because there's no trigger for a second pull. To really exercise the race, the test would need to let pull enter the reconnect branch before cancel (e.g. drain all data + timeout frame before cancelling). That said, it's still useful as a guard against future regressions where someone might trigger reconnects asynchronously.
  • Test 3 (cancels the active reader when cancel is called during a read): WHATWG streams semantics already make reader.cancel() propagate to the upstream body reader, so this likely passed pre-fix too.

Not blocking — the primary fix is well-verified by test 1.

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

@VaguelySerious@TooTallNate
, '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" + ' [world-vercel] Propagate cancel from streams.get to upstream fetch by VaguelySerious · Pull Request #1802 · vercel/workflow · GitHub
Skip to content

[world-vercel] Propagate cancel from streams.get to upstream fetch - #1802

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main
Closed

[world-vercel] Propagate cancel from streams.get to upstream fetch#1802
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

Forward-port of #1801 onto main. Same class of bug, different function shape (streams.get(runId, name, startIndex) here vs. readFromStream(name, startIndex) on stable).

When a consumer cancels the ReadableStream returned by streams.get() (e.g. an HTTP client disconnects from an API route that pipes run.getReadable()), the pull loop in the streamer kept running and could trigger further reconnects in the background. The in-flight upstream fetch was never aborted, so the endpoint kept fetching long after the client had gone away.

Root cause

  1. No cancelled flag — pull had no way to know the consumer asked to stop.
  2. No AbortSignal on the upstream fetch() — even if we noticed, there was no way to unblock a pending request.

The cancel handler only called reader.cancel() on whichever reader was captured at that moment. If pull was mid-reconnect (reader = await connect()), cancel cancelled the stale reader; the new fetch then connected and kept streaming.

Fix

  • Track a cancelled flag that pull checks before and after each reader.read() and before each connect().
  • Plumb an AbortController.signal into fetch, aborted from cancel, so the in-flight request (including a pending reconnect) unblocks.
  • connect() failures triggered by abort are swallowed silently when cancelled.

Tests

Three new tests under a new streams.get consumer cancel describe block:

  • aborts the in-flight upstream fetch via AbortSignal — fails on main without the fix; asserts fetch was called with an AbortSignal and that the signal is aborted after stream.cancel().
  • does not reconnect after the consumer cancels mid-timeout — documents that no further fetch is initiated after cancel.
  • cancels the active reader when cancel is called during a read — documents that cancel unblocks a pending reader.read().

All 32 world-vercel streamer tests pass locally.

Companion

Test plan

  • pnpm vitest run — all world-vercel tests pass
  • Typecheck clean
  • CI + workflow-server auto e2e

🤖 Generated with Claude Code

When a consumer cancels the ReadableStream returned by streams.get
(e.g. an HTTP client hanging up on an endpoint that pipes
`run.getReadable()`), the pull loop could continue running and even
trigger a fresh reconnect via `connect()` — the new fetch was never
tied to the cancellation, so the request kept running in the
background.
Fix:
- Track a `cancelled` flag that `pull` checks before and after each
read and before each reconnect.
- Plumb an `AbortController.signal` into `fetch` so the in-flight
upstream request (including a pending reconnect) is aborted when
the consumer cancels.
Regression tests cover the abort-signal contract, the mid-timeout
reconnect race, and cancel-during-read.
Port of #1801 (targeting `stable`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9de9271

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

This PR includes changesets to release 18 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/aiPatch
@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 Apr 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9450671012
❌ 💻 Local Development10171861104
✅ 📦 Local Production10180861104
✅ 🐘 Local Postgres10180861104
✅ 📋 Other258018276
Total425613434600

❌ Failed Tests

💻 Local Development (1 failed)

vite-stable (1 failed):

  • hookWorkflow | wrun_01KPEF76M376DM0WQEFASYBKMY

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8507
✅ example8507
✅ express8507
✅ fastify8507
✅ hono8507
✅ nextjs-turbopack9002
✅ nextjs-webpack9002
✅ nitro8507
✅ nuxt8507
✅ sveltekit8507
✅ vite8507
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
❌ vite-stable8516
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8606
✅ e2e-local-postgres-nest-stable8606
✅ e2e-local-prod-nest-stable8606

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 17, 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.044s (+1.4%)1.005s (~)0.962s101.00x
💻 LocalExpress0.044s (-0.9%)1.005s (~)0.961s101.00x
💻 LocalNext.js (Turbopack)0.048s1.005s0.957s101.09x
🐘 PostgresExpress0.057s (-2.1%)1.011s (~)0.955s101.30x
🐘 PostgresNext.js (Turbopack)0.058s1.009s0.951s101.33x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.215s (-8.6% 🟢)1.900s (-11.0% 🟢)1.685s101.00x
▲ VercelNitro0.254s (-38.0% 🟢)1.794s (-28.5% 🟢)1.540s101.18x
▲ VercelNext.js (Turbopack)0.264s (+5.1% 🔺)2.153s (-7.7% 🟢)1.889s101.23x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.123s2.005s0.882s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.878s101.00x
💻 LocalExpress1.129s (~)2.005s (~)0.876s101.00x
🐘 PostgresNext.js (Turbopack)1.139s2.009s0.870s101.01x
🐘 PostgresExpress1.153s (+0.5%)2.010s (~)0.857s101.03x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.945s (+3.7%)3.789s (~)1.844s101.00x
▲ VercelNext.js (Turbopack)2.087s (+2.5%)3.450s (-9.9% 🟢)1.363s101.07x
▲ VercelNitro2.112s (-45.7% 🟢)3.337s (-43.5% 🟢)1.225s101.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.778s11.022s0.245s31.00x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.01x
💻 LocalExpress10.927s (~)11.023s (~)0.097s31.01x
🐘 PostgresNext.js (Turbopack)10.939s11.020s0.082s31.01x
💻 LocalNitro10.942s (~)11.023s (~)0.081s31.02x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)19.107s (+10.3% 🔺)20.648s (+6.4% 🔺)1.542s21.00x
▲ VercelExpress20.625s (+21.5% 🔺)22.950s (+14.6% 🔺)2.326s21.08x
▲ VercelNitro22.424s (-5.5% 🟢)24.009s (-4.4%)1.585s21.17x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.499s15.020s0.520s41.00x
💻 LocalNext.js (Turbopack)14.627s15.029s0.402s41.01x
🐘 PostgresExpress14.633s (~)15.025s (~)0.392s41.01x
💻 LocalNitro14.994s (~)15.280s (-4.7%)0.286s41.03x
💻 LocalExpress15.033s (~)15.280s (+1.7%)0.247s41.04x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.730s (-36.9% 🟢)33.288s (-36.7% 🟢)1.558s21.00x
▲ VercelNitro32.513s (-49.6% 🟢)33.549s (-49.6% 🟢)1.037s21.02x
▲ VercelNext.js (Turbopack)34.645s (-34.1% 🟢)36.196s (-33.7% 🟢)1.551s21.09x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.972s (~)14.310s (-1.9%)0.338s71.00x
🐘 PostgresNext.js (Turbopack)13.996s14.306s0.310s71.00x
💻 LocalNext.js (Turbopack)16.008s16.363s0.354s61.15x
💻 LocalNitro16.765s (~)17.031s (~)0.266s61.20x
💻 LocalExpress16.821s (+1.3%)17.199s (+1.0%)0.378s61.20x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express55.760s (-54.0% 🟢)57.850s (-53.2% 🟢)2.090s21.00x
▲ VercelNext.js (Turbopack)58.773s (-85.1% 🟢)60.892s (-84.6% 🟢)2.119s21.05x
▲ VercelNitro58.992s (-86.1% 🟢)59.843s (-85.9% 🟢)0.852s21.06x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.237s2.009s0.771s151.00x
🐘 PostgresExpress1.271s (+0.8%)2.010s (~)0.739s151.03x
💻 LocalNext.js (Turbopack)1.565s2.073s0.508s151.26x
💻 LocalNitro1.569s (-3.8%)2.006s (-3.3%)0.438s151.27x
💻 LocalExpress1.591s (+6.9% 🔺)2.072s (+3.3%)0.481s151.29x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.177s (-23.9% 🟢)3.957s (-14.4% 🟢)1.780s81.00x
▲ VercelNitro2.266s (-19.6% 🟢)3.575s (-17.3% 🟢)1.309s91.04x
▲ VercelNext.js (Turbopack)2.491s (-26.7% 🟢)3.966s (-19.6% 🟢)1.475s81.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.326s (-1.5%)3.008s (~)0.682s101.00x
🐘 PostgresNext.js (Turbopack)2.414s3.009s0.595s101.04x
💻 LocalExpress2.853s (-3.4%)3.209s (-7.1% 🟢)0.355s101.23x
💻 LocalNext.js (Turbopack)2.870s3.109s0.239s101.23x
💻 LocalNitro3.075s (-2.2%)3.676s (-5.4% 🟢)0.602s91.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.427s (-40.1% 🟢)3.659s (-38.2% 🟢)1.232s91.00x
▲ VercelExpress2.597s (-28.2% 🟢)3.934s (-23.0% 🟢)1.337s81.07x
▲ VercelNext.js (Turbopack)2.605s (-63.3% 🟢)4.047s (-54.6% 🟢)1.442s81.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.487s (~)4.009s (~)0.522s81.00x
🐘 PostgresNext.js (Turbopack)3.660s4.010s0.350s81.05x
💻 LocalNext.js (Turbopack)7.234s7.765s0.532s42.07x
💻 LocalExpress7.298s (-12.5% 🟢)8.019s (-11.2% 🟢)0.721s42.09x
💻 LocalNitro8.550s (+2.4%)9.025s (~)0.475s42.45x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.074s (-12.8% 🟢)4.414s (-20.2% 🟢)1.340s81.00x
▲ VercelExpress3.138s (-26.0% 🟢)5.027s (-18.0% 🟢)1.889s71.02x
▲ VercelNext.js (Turbopack)4.736s (-46.9% 🟢)6.298s (-42.5% 🟢)1.562s51.54x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.235s2.009s0.774s151.00x
🐘 PostgresExpress1.264s (+0.5%)2.007s (~)0.744s151.02x
💻 LocalNext.js (Turbopack)1.508s2.005s0.497s151.22x
💻 LocalExpress1.517s (-19.9% 🟢)2.006s (-15.1% 🟢)0.489s151.23x
💻 LocalNitro1.557s (-16.5% 🟢)2.006s (-14.3% 🟢)0.449s151.26x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.144s (-16.9% 🟢)4.110s (-5.5% 🟢)1.966s81.00x
▲ VercelNext.js (Turbopack)2.156s (-26.5% 🟢)3.524s (-24.1% 🟢)1.368s91.01x
▲ VercelNitro2.427s (-1.3%)3.595s (-13.8% 🟢)1.168s91.13x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.352s (~)3.009s (~)0.657s101.00x
🐘 PostgresNext.js (Turbopack)2.387s3.009s0.622s101.01x
💻 LocalExpress2.940s (-6.1% 🟢)3.341s (-11.2% 🟢)0.401s91.25x
💻 LocalNext.js (Turbopack)2.961s3.760s0.799s81.26x
💻 LocalNitro3.055s (~)3.759s (-3.3%)0.704s81.30x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.296s (-28.1% 🟢)3.931s (-18.0% 🟢)1.635s81.00x
▲ VercelNitro2.679s (-17.1% 🟢)3.957s (-22.1% 🟢)1.277s91.17x
▲ VercelNext.js (Turbopack)2.758s (-12.2% 🟢)4.045s (-10.5% 🟢)1.287s81.20x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.489s (~)4.011s (~)0.521s81.00x
🐘 PostgresNext.js (Turbopack)3.668s4.010s0.341s81.05x
💻 LocalExpress7.974s (-9.4% 🟢)8.524s (-8.1% 🟢)0.549s42.29x
💻 LocalNext.js (Turbopack)8.849s9.524s0.675s42.54x
💻 LocalNitro9.056s (-1.0%)9.523s (-5.0% 🟢)0.467s42.60x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.854s (-44.0% 🟢)4.359s (-36.1% 🟢)1.505s71.00x
▲ VercelExpress2.952s (-54.0% 🟢)4.606s (-43.7% 🟢)1.655s71.03x
▲ VercelNext.js (Turbopack)3.820s (-43.5% 🟢)5.366s (-37.2% 🟢)1.546s61.34x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.778s1.023s0.244s591.00x
🐘 PostgresExpress0.822s (-2.1%)1.006s (-1.6%)0.185s601.06x
💻 LocalNext.js (Turbopack)0.844s1.004s0.160s601.08x
💻 LocalExpress1.013s (+3.0%)1.672s (+55.4% 🔺)0.659s361.30x
💻 LocalNitro1.026s (+4.7%)1.800s (+64.6% 🔺)0.774s341.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)9.041s (-37.7% 🟢)10.605s (-34.1% 🟢)1.564s61.00x
▲ VercelNitro9.167s (-58.4% 🟢)10.774s (-55.2% 🟢)1.608s61.01x
▲ VercelExpress9.420s (-50.5% 🟢)10.934s (-48.7% 🟢)1.514s61.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.908s2.124s0.216s431.00x
🐘 PostgresExpress1.976s (~)2.258s (~)0.282s401.04x
💻 LocalNext.js (Turbopack)2.641s3.007s0.366s301.38x
💻 LocalExpress3.022s (~)3.689s (+2.9%)0.667s251.58x
💻 LocalNitro3.063s (+0.9%)3.922s (+4.4%)0.859s231.61x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)28.897s (-42.0% 🟢)30.300s (-41.4% 🟢)1.404s31.00x
▲ VercelNitro29.540s (-25.2% 🟢)31.066s (-24.8% 🟢)1.525s31.02x
▲ VercelExpress29.717s (-13.9% 🟢)31.535s (-14.3% 🟢)1.818s31.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.867s4.010s0.143s301.00x
🐘 PostgresExpress4.012s (+0.5%)4.493s (+2.8%)0.482s271.04x
💻 LocalNext.js (Turbopack)8.486s9.017s0.531s142.19x
💻 LocalExpress9.064s (-1.6%)9.478s (-5.4% 🟢)0.414s132.34x
💻 LocalNitro9.278s (~)9.942s (-0.8%)0.664s132.40x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro71.447s (-26.3% 🟢)73.075s (-25.8% 🟢)1.628s21.00x
▲ VercelExpress72.056s (-44.6% 🟢)73.881s (-44.1% 🟢)1.825s21.01x
▲ VercelNext.js (Turbopack)74.567s (-30.4% 🟢)76.256s (-30.0% 🟢)1.690s21.04x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.249s1.007s0.758s601.00x
🐘 PostgresExpress0.289s (+2.3%)1.007s (~)0.718s601.16x
💻 LocalNext.js (Turbopack)0.544s1.004s0.461s602.19x
💻 LocalNitro0.592s (-2.1%)1.022s (~)0.430s592.38x
💻 LocalExpress0.604s (+7.8% 🔺)1.021s (+1.7%)0.417s592.43x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.416s (-27.6% 🟢)2.982s (-18.0% 🟢)1.567s211.00x
▲ VercelNitro1.604s (-3.4%)2.969s (-11.4% 🟢)1.365s211.13x
▲ VercelNext.js (Turbopack)1.608s (-20.5% 🟢)3.112s (-18.0% 🟢)1.504s201.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s1.006s0.520s901.00x
🐘 PostgresExpress0.501s (-1.7%)1.007s (~)0.506s901.03x
💻 LocalExpress2.376s (-5.5% 🟢)3.008s (~)0.632s304.89x
💻 LocalNext.js (Turbopack)2.525s3.009s0.484s305.20x
💻 LocalNitro2.585s (+1.9%)3.009s (~)0.424s305.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.851s (-11.6% 🟢)4.168s (-13.5% 🟢)1.317s221.00x
▲ VercelExpress2.858s (-6.2% 🟢)4.555s (-5.2% 🟢)1.697s201.00x
▲ VercelNext.js (Turbopack)3.341s (-5.5% 🟢)4.972s (-4.3%)1.631s191.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.781s1.007s0.225s1201.00x
🐘 PostgresExpress0.822s (~)1.010s (-0.7%)0.188s1191.05x
💻 LocalExpress10.571s (-5.5% 🟢)11.027s (-7.7% 🟢)0.456s1113.53x
💻 LocalNext.js (Turbopack)10.643s11.207s0.564s1113.63x
💻 LocalNitro11.261s (+0.6%)11.848s (+1.6%)0.587s1114.42x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.395s (-28.4% 🟢)9.144s (-25.6% 🟢)1.748s141.00x
▲ VercelExpress7.507s (+1.2%)9.507s (+2.8%)2.000s131.02x
▲ VercelNitro7.762s (+0.5%)9.268s (-1.4%)1.505s131.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.169s1.003s0.012s1.018s0.848s101.00x
🐘 PostgresExpress0.203s (-1.0%)1.000s (~)0.002s (-6.3% 🟢)1.010s (~)0.807s101.20x
💻 LocalNitro0.204s (-4.6%)1.004s (~)0.011s (-9.6% 🟢)1.018s (~)0.814s101.21x
🐘 PostgresNext.js (Turbopack)0.204s1.001s0.001s1.011s0.806s101.21x
💻 LocalExpress0.227s (+14.2% 🔺)1.004s (~)0.010s (-18.2% 🟢)1.016s (~)0.788s101.34x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.495s (-78.2% 🟢)2.793s (-67.7% 🟢)0.933s (+47.7% 🔺)4.135s (-57.8% 🟢)2.641s101.00x
▲ VercelExpress1.627s (-35.1% 🟢)3.231s (-21.0% 🟢)0.668s (-30.5% 🟢)4.341s (-22.3% 🟢)2.715s101.09x
▲ VercelNitro1.672s (-56.4% 🟢)2.805s (-46.8% 🟢)1.109s (+49.4% 🔺)4.338s (-33.1% 🟢)2.665s101.12x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.609s1.009s0.005s1.022s0.413s591.00x
🐘 PostgresExpress0.632s (~)1.021s (+1.4%)0.004s (+4.4%)1.042s (+1.8%)0.410s581.04x
💻 LocalNext.js (Turbopack)0.756s1.011s0.010s1.117s0.361s541.24x
💻 LocalNitro0.769s (-8.3% 🟢)1.012s (~)0.012s (+25.4% 🔺)1.026s (-8.1% 🟢)0.257s591.26x
💻 LocalExpress0.857s (+13.1% 🔺)1.012s (-1.7%)0.012s (+22.4% 🔺)1.118s (+7.5% 🔺)0.262s541.41x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.777s (-11.2% 🟢)7.473s (-6.7% 🟢)0.185s (-54.8% 🟢)8.112s (-8.2% 🟢)2.335s81.00x
▲ VercelNext.js (Turbopack)6.719s (-60.3% 🟢)8.047s (-55.9% 🟢)0.186s (-11.8% 🟢)8.612s (-54.5% 🟢)1.892s71.16x
▲ VercelNitro8.246s (-72.0% 🟢)9.624s (-68.8% 🟢)0.167s (+48.7% 🔺)10.158s (-68.0% 🟢)1.912s61.43x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.919s1.072s0.000s1.080s0.161s561.00x
🐘 PostgresExpress0.984s (+2.4%)1.301s (+1.8%)0.000s (~)1.328s (+1.7%)0.344s461.07x
💻 LocalExpress1.238s (+1.0%)2.020s (~)0.000s (+30.0% 🔺)2.022s (~)0.785s301.35x
💻 LocalNext.js (Turbopack)1.241s2.019s0.000s2.022s0.781s301.35x
💻 LocalNitro1.433s (+17.2% 🔺)2.023s (~)0.000s (+292.9% 🔺)2.204s (+9.0% 🔺)0.771s281.56x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.869s (-6.0% 🟢)4.073s (-7.3% 🟢)0.000s (-7.1% 🟢)4.417s (-8.2% 🟢)1.548s141.00x
▲ VercelExpress2.934s (-21.6% 🟢)4.316s (-15.4% 🟢)0.000s (-100.0% 🟢)4.733s (-14.4% 🟢)1.799s131.02x
▲ VercelNext.js (Turbopack)3.017s (-70.4% 🟢)4.293s (-62.7% 🟢)0.000s (+Infinity% 🔺)4.672s (-61.2% 🟢)1.655s141.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.793s (+1.2%)2.143s (-1.6%)0.000s (+Infinity% 🔺)2.152s (-2.1%)0.359s281.00x
🐘 PostgresNext.js (Turbopack)1.844s2.145s0.000s2.152s0.308s281.03x
💻 LocalNext.js (Turbopack)3.508s4.033s0.000s4.036s0.528s151.96x
💻 LocalExpress3.603s (+3.9%)4.101s (+1.7%)0.001s (-8.3% 🟢)4.105s (+1.7%)0.502s152.01x
💻 LocalNitro3.674s (+8.5% 🔺)4.164s (+3.3%)0.001s (~)4.167s (+3.2%)0.493s152.05x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.063s (-0.8%)5.253s (-2.2%)0.000s (-100.0% 🟢)5.588s (-3.5%)1.526s111.00x
▲ VercelExpress4.167s (-9.2% 🟢)5.682s (-5.6% 🟢)0.000s (NaN%)6.087s (-5.7% 🟢)1.920s111.03x
▲ VercelNext.js (Turbopack)4.455s (-20.7% 🟢)5.836s (-16.4% 🟢)0.000s (-100.0% 🟢)6.230s (-17.4% 🟢)1.774s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)14/21
🐘 PostgresNext.js (Turbopack)12/21
▲ VercelExpress9/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres16/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro💻 Local16/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)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

Comment thread.changeset/stream-cancel-propagation-main.md Outdated
Comment threadpackages/world-vercel/src/streamer.ts Outdated
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, well-scoped fix. Forward-port of #1801 for main. The approach — cancelled flag as the source of truth plus a single shared AbortController for the whole stream lifetime — is the right pattern for this class of bug.

What looks good

  • Cancellation checks at all the right points: before reader.read(), after reader.read() (covers the case where read completed naturally between abort and flag check), and before reconnect(). Combined with the AbortController plumbed into fetch, this covers all the race windows:

    • Cancel before any pull → initial reader gets cancelled, pull is never invoked
    • Cancel during active read → AbortError swallowed, exits cleanly
    • Cancel during reconnect → in-flight fetch aborted, caught, exits cleanly
    • Cancel between reconnect completion and next read → flag checked at top of loop
  • Shared AbortController across all reconnects is correct. Once aborted, it stays aborted, which means all future connect() calls abort instantly. Right primitive for whole-stream cancellation.

  • Reconnect try/catch properly distinguishes abort-from-cancel (return silently) vs. real errors (propagate via controller.error).

  • reader.cancel().catch() on the closure variable — the comment explicitly acknowledges the TOCTOU window and explains why the cancelled flag is the real guarantee. Good defense-in-depth comment.

  • Changeset correctly scoped to @workflow/world-vercel only.

Test coverage observations

The PR description calls out test 1 (aborts the in-flight upstream fetch via AbortSignal) as failing on main without the fix — I agree, that's the strongest test.

Tests 2 and 3 are more like documentation/regression guards than fix verifications:

  • Test 2 (does not reconnect after the consumer cancels mid-timeout): the test never calls read() after the first one, so pull is never re-invoked — no reconnect path is actually exercised. Pre-fix, fetchCount would also be 1 simply because there's no trigger for a second pull. To really exercise the race, the test would need to let pull enter the reconnect branch before cancel (e.g. drain all data + timeout frame before cancelling). That said, it's still useful as a guard against future regressions where someone might trigger reconnects asynchronously.
  • Test 3 (cancels the active reader when cancel is called during a read): WHATWG streams semantics already make reader.cancel() propagate to the upstream body reader, so this likely passed pre-fix too.

Not blocking — the primary fix is well-verified by test 1.

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

@VaguelySerious@TooTallNate
, '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('^' + ".*" + ' [world-vercel] Propagate cancel from streams.get to upstream fetch by VaguelySerious · Pull Request #1802 · vercel/workflow · GitHub
Skip to content

[world-vercel] Propagate cancel from streams.get to upstream fetch - #1802

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main
Closed

[world-vercel] Propagate cancel from streams.get to upstream fetch#1802
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

Forward-port of #1801 onto main. Same class of bug, different function shape (streams.get(runId, name, startIndex) here vs. readFromStream(name, startIndex) on stable).

When a consumer cancels the ReadableStream returned by streams.get() (e.g. an HTTP client disconnects from an API route that pipes run.getReadable()), the pull loop in the streamer kept running and could trigger further reconnects in the background. The in-flight upstream fetch was never aborted, so the endpoint kept fetching long after the client had gone away.

Root cause

  1. No cancelled flag — pull had no way to know the consumer asked to stop.
  2. No AbortSignal on the upstream fetch() — even if we noticed, there was no way to unblock a pending request.

The cancel handler only called reader.cancel() on whichever reader was captured at that moment. If pull was mid-reconnect (reader = await connect()), cancel cancelled the stale reader; the new fetch then connected and kept streaming.

Fix

  • Track a cancelled flag that pull checks before and after each reader.read() and before each connect().
  • Plumb an AbortController.signal into fetch, aborted from cancel, so the in-flight request (including a pending reconnect) unblocks.
  • connect() failures triggered by abort are swallowed silently when cancelled.

Tests

Three new tests under a new streams.get consumer cancel describe block:

  • aborts the in-flight upstream fetch via AbortSignal — fails on main without the fix; asserts fetch was called with an AbortSignal and that the signal is aborted after stream.cancel().
  • does not reconnect after the consumer cancels mid-timeout — documents that no further fetch is initiated after cancel.
  • cancels the active reader when cancel is called during a read — documents that cancel unblocks a pending reader.read().

All 32 world-vercel streamer tests pass locally.

Companion

Test plan

  • pnpm vitest run — all world-vercel tests pass
  • Typecheck clean
  • CI + workflow-server auto e2e

🤖 Generated with Claude Code

When a consumer cancels the ReadableStream returned by streams.get
(e.g. an HTTP client hanging up on an endpoint that pipes
`run.getReadable()`), the pull loop could continue running and even
trigger a fresh reconnect via `connect()` — the new fetch was never
tied to the cancellation, so the request kept running in the
background.
Fix:
- Track a `cancelled` flag that `pull` checks before and after each
read and before each reconnect.
- Plumb an `AbortController.signal` into `fetch` so the in-flight
upstream request (including a pending reconnect) is aborted when
the consumer cancels.
Regression tests cover the abort-signal contract, the mid-timeout
reconnect race, and cancel-during-read.
Port of #1801 (targeting `stable`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9de9271

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

This PR includes changesets to release 18 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/aiPatch
@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 Apr 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9450671012
❌ 💻 Local Development10171861104
✅ 📦 Local Production10180861104
✅ 🐘 Local Postgres10180861104
✅ 📋 Other258018276
Total425613434600

❌ Failed Tests

💻 Local Development (1 failed)

vite-stable (1 failed):

  • hookWorkflow | wrun_01KPEF76M376DM0WQEFASYBKMY

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8507
✅ example8507
✅ express8507
✅ fastify8507
✅ hono8507
✅ nextjs-turbopack9002
✅ nextjs-webpack9002
✅ nitro8507
✅ nuxt8507
✅ sveltekit8507
✅ vite8507
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
❌ vite-stable8516
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8606
✅ e2e-local-postgres-nest-stable8606
✅ e2e-local-prod-nest-stable8606

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 17, 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.044s (+1.4%)1.005s (~)0.962s101.00x
💻 LocalExpress0.044s (-0.9%)1.005s (~)0.961s101.00x
💻 LocalNext.js (Turbopack)0.048s1.005s0.957s101.09x
🐘 PostgresExpress0.057s (-2.1%)1.011s (~)0.955s101.30x
🐘 PostgresNext.js (Turbopack)0.058s1.009s0.951s101.33x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.215s (-8.6% 🟢)1.900s (-11.0% 🟢)1.685s101.00x
▲ VercelNitro0.254s (-38.0% 🟢)1.794s (-28.5% 🟢)1.540s101.18x
▲ VercelNext.js (Turbopack)0.264s (+5.1% 🔺)2.153s (-7.7% 🟢)1.889s101.23x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.123s2.005s0.882s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.878s101.00x
💻 LocalExpress1.129s (~)2.005s (~)0.876s101.00x
🐘 PostgresNext.js (Turbopack)1.139s2.009s0.870s101.01x
🐘 PostgresExpress1.153s (+0.5%)2.010s (~)0.857s101.03x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.945s (+3.7%)3.789s (~)1.844s101.00x
▲ VercelNext.js (Turbopack)2.087s (+2.5%)3.450s (-9.9% 🟢)1.363s101.07x
▲ VercelNitro2.112s (-45.7% 🟢)3.337s (-43.5% 🟢)1.225s101.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.778s11.022s0.245s31.00x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.01x
💻 LocalExpress10.927s (~)11.023s (~)0.097s31.01x
🐘 PostgresNext.js (Turbopack)10.939s11.020s0.082s31.01x
💻 LocalNitro10.942s (~)11.023s (~)0.081s31.02x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)19.107s (+10.3% 🔺)20.648s (+6.4% 🔺)1.542s21.00x
▲ VercelExpress20.625s (+21.5% 🔺)22.950s (+14.6% 🔺)2.326s21.08x
▲ VercelNitro22.424s (-5.5% 🟢)24.009s (-4.4%)1.585s21.17x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.499s15.020s0.520s41.00x
💻 LocalNext.js (Turbopack)14.627s15.029s0.402s41.01x
🐘 PostgresExpress14.633s (~)15.025s (~)0.392s41.01x
💻 LocalNitro14.994s (~)15.280s (-4.7%)0.286s41.03x
💻 LocalExpress15.033s (~)15.280s (+1.7%)0.247s41.04x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.730s (-36.9% 🟢)33.288s (-36.7% 🟢)1.558s21.00x
▲ VercelNitro32.513s (-49.6% 🟢)33.549s (-49.6% 🟢)1.037s21.02x
▲ VercelNext.js (Turbopack)34.645s (-34.1% 🟢)36.196s (-33.7% 🟢)1.551s21.09x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.972s (~)14.310s (-1.9%)0.338s71.00x
🐘 PostgresNext.js (Turbopack)13.996s14.306s0.310s71.00x
💻 LocalNext.js (Turbopack)16.008s16.363s0.354s61.15x
💻 LocalNitro16.765s (~)17.031s (~)0.266s61.20x
💻 LocalExpress16.821s (+1.3%)17.199s (+1.0%)0.378s61.20x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express55.760s (-54.0% 🟢)57.850s (-53.2% 🟢)2.090s21.00x
▲ VercelNext.js (Turbopack)58.773s (-85.1% 🟢)60.892s (-84.6% 🟢)2.119s21.05x
▲ VercelNitro58.992s (-86.1% 🟢)59.843s (-85.9% 🟢)0.852s21.06x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.237s2.009s0.771s151.00x
🐘 PostgresExpress1.271s (+0.8%)2.010s (~)0.739s151.03x
💻 LocalNext.js (Turbopack)1.565s2.073s0.508s151.26x
💻 LocalNitro1.569s (-3.8%)2.006s (-3.3%)0.438s151.27x
💻 LocalExpress1.591s (+6.9% 🔺)2.072s (+3.3%)0.481s151.29x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.177s (-23.9% 🟢)3.957s (-14.4% 🟢)1.780s81.00x
▲ VercelNitro2.266s (-19.6% 🟢)3.575s (-17.3% 🟢)1.309s91.04x
▲ VercelNext.js (Turbopack)2.491s (-26.7% 🟢)3.966s (-19.6% 🟢)1.475s81.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.326s (-1.5%)3.008s (~)0.682s101.00x
🐘 PostgresNext.js (Turbopack)2.414s3.009s0.595s101.04x
💻 LocalExpress2.853s (-3.4%)3.209s (-7.1% 🟢)0.355s101.23x
💻 LocalNext.js (Turbopack)2.870s3.109s0.239s101.23x
💻 LocalNitro3.075s (-2.2%)3.676s (-5.4% 🟢)0.602s91.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.427s (-40.1% 🟢)3.659s (-38.2% 🟢)1.232s91.00x
▲ VercelExpress2.597s (-28.2% 🟢)3.934s (-23.0% 🟢)1.337s81.07x
▲ VercelNext.js (Turbopack)2.605s (-63.3% 🟢)4.047s (-54.6% 🟢)1.442s81.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.487s (~)4.009s (~)0.522s81.00x
🐘 PostgresNext.js (Turbopack)3.660s4.010s0.350s81.05x
💻 LocalNext.js (Turbopack)7.234s7.765s0.532s42.07x
💻 LocalExpress7.298s (-12.5% 🟢)8.019s (-11.2% 🟢)0.721s42.09x
💻 LocalNitro8.550s (+2.4%)9.025s (~)0.475s42.45x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.074s (-12.8% 🟢)4.414s (-20.2% 🟢)1.340s81.00x
▲ VercelExpress3.138s (-26.0% 🟢)5.027s (-18.0% 🟢)1.889s71.02x
▲ VercelNext.js (Turbopack)4.736s (-46.9% 🟢)6.298s (-42.5% 🟢)1.562s51.54x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.235s2.009s0.774s151.00x
🐘 PostgresExpress1.264s (+0.5%)2.007s (~)0.744s151.02x
💻 LocalNext.js (Turbopack)1.508s2.005s0.497s151.22x
💻 LocalExpress1.517s (-19.9% 🟢)2.006s (-15.1% 🟢)0.489s151.23x
💻 LocalNitro1.557s (-16.5% 🟢)2.006s (-14.3% 🟢)0.449s151.26x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.144s (-16.9% 🟢)4.110s (-5.5% 🟢)1.966s81.00x
▲ VercelNext.js (Turbopack)2.156s (-26.5% 🟢)3.524s (-24.1% 🟢)1.368s91.01x
▲ VercelNitro2.427s (-1.3%)3.595s (-13.8% 🟢)1.168s91.13x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.352s (~)3.009s (~)0.657s101.00x
🐘 PostgresNext.js (Turbopack)2.387s3.009s0.622s101.01x
💻 LocalExpress2.940s (-6.1% 🟢)3.341s (-11.2% 🟢)0.401s91.25x
💻 LocalNext.js (Turbopack)2.961s3.760s0.799s81.26x
💻 LocalNitro3.055s (~)3.759s (-3.3%)0.704s81.30x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.296s (-28.1% 🟢)3.931s (-18.0% 🟢)1.635s81.00x
▲ VercelNitro2.679s (-17.1% 🟢)3.957s (-22.1% 🟢)1.277s91.17x
▲ VercelNext.js (Turbopack)2.758s (-12.2% 🟢)4.045s (-10.5% 🟢)1.287s81.20x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.489s (~)4.011s (~)0.521s81.00x
🐘 PostgresNext.js (Turbopack)3.668s4.010s0.341s81.05x
💻 LocalExpress7.974s (-9.4% 🟢)8.524s (-8.1% 🟢)0.549s42.29x
💻 LocalNext.js (Turbopack)8.849s9.524s0.675s42.54x
💻 LocalNitro9.056s (-1.0%)9.523s (-5.0% 🟢)0.467s42.60x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.854s (-44.0% 🟢)4.359s (-36.1% 🟢)1.505s71.00x
▲ VercelExpress2.952s (-54.0% 🟢)4.606s (-43.7% 🟢)1.655s71.03x
▲ VercelNext.js (Turbopack)3.820s (-43.5% 🟢)5.366s (-37.2% 🟢)1.546s61.34x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.778s1.023s0.244s591.00x
🐘 PostgresExpress0.822s (-2.1%)1.006s (-1.6%)0.185s601.06x
💻 LocalNext.js (Turbopack)0.844s1.004s0.160s601.08x
💻 LocalExpress1.013s (+3.0%)1.672s (+55.4% 🔺)0.659s361.30x
💻 LocalNitro1.026s (+4.7%)1.800s (+64.6% 🔺)0.774s341.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)9.041s (-37.7% 🟢)10.605s (-34.1% 🟢)1.564s61.00x
▲ VercelNitro9.167s (-58.4% 🟢)10.774s (-55.2% 🟢)1.608s61.01x
▲ VercelExpress9.420s (-50.5% 🟢)10.934s (-48.7% 🟢)1.514s61.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.908s2.124s0.216s431.00x
🐘 PostgresExpress1.976s (~)2.258s (~)0.282s401.04x
💻 LocalNext.js (Turbopack)2.641s3.007s0.366s301.38x
💻 LocalExpress3.022s (~)3.689s (+2.9%)0.667s251.58x
💻 LocalNitro3.063s (+0.9%)3.922s (+4.4%)0.859s231.61x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)28.897s (-42.0% 🟢)30.300s (-41.4% 🟢)1.404s31.00x
▲ VercelNitro29.540s (-25.2% 🟢)31.066s (-24.8% 🟢)1.525s31.02x
▲ VercelExpress29.717s (-13.9% 🟢)31.535s (-14.3% 🟢)1.818s31.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.867s4.010s0.143s301.00x
🐘 PostgresExpress4.012s (+0.5%)4.493s (+2.8%)0.482s271.04x
💻 LocalNext.js (Turbopack)8.486s9.017s0.531s142.19x
💻 LocalExpress9.064s (-1.6%)9.478s (-5.4% 🟢)0.414s132.34x
💻 LocalNitro9.278s (~)9.942s (-0.8%)0.664s132.40x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro71.447s (-26.3% 🟢)73.075s (-25.8% 🟢)1.628s21.00x
▲ VercelExpress72.056s (-44.6% 🟢)73.881s (-44.1% 🟢)1.825s21.01x
▲ VercelNext.js (Turbopack)74.567s (-30.4% 🟢)76.256s (-30.0% 🟢)1.690s21.04x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.249s1.007s0.758s601.00x
🐘 PostgresExpress0.289s (+2.3%)1.007s (~)0.718s601.16x
💻 LocalNext.js (Turbopack)0.544s1.004s0.461s602.19x
💻 LocalNitro0.592s (-2.1%)1.022s (~)0.430s592.38x
💻 LocalExpress0.604s (+7.8% 🔺)1.021s (+1.7%)0.417s592.43x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.416s (-27.6% 🟢)2.982s (-18.0% 🟢)1.567s211.00x
▲ VercelNitro1.604s (-3.4%)2.969s (-11.4% 🟢)1.365s211.13x
▲ VercelNext.js (Turbopack)1.608s (-20.5% 🟢)3.112s (-18.0% 🟢)1.504s201.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s1.006s0.520s901.00x
🐘 PostgresExpress0.501s (-1.7%)1.007s (~)0.506s901.03x
💻 LocalExpress2.376s (-5.5% 🟢)3.008s (~)0.632s304.89x
💻 LocalNext.js (Turbopack)2.525s3.009s0.484s305.20x
💻 LocalNitro2.585s (+1.9%)3.009s (~)0.424s305.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.851s (-11.6% 🟢)4.168s (-13.5% 🟢)1.317s221.00x
▲ VercelExpress2.858s (-6.2% 🟢)4.555s (-5.2% 🟢)1.697s201.00x
▲ VercelNext.js (Turbopack)3.341s (-5.5% 🟢)4.972s (-4.3%)1.631s191.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.781s1.007s0.225s1201.00x
🐘 PostgresExpress0.822s (~)1.010s (-0.7%)0.188s1191.05x
💻 LocalExpress10.571s (-5.5% 🟢)11.027s (-7.7% 🟢)0.456s1113.53x
💻 LocalNext.js (Turbopack)10.643s11.207s0.564s1113.63x
💻 LocalNitro11.261s (+0.6%)11.848s (+1.6%)0.587s1114.42x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.395s (-28.4% 🟢)9.144s (-25.6% 🟢)1.748s141.00x
▲ VercelExpress7.507s (+1.2%)9.507s (+2.8%)2.000s131.02x
▲ VercelNitro7.762s (+0.5%)9.268s (-1.4%)1.505s131.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.169s1.003s0.012s1.018s0.848s101.00x
🐘 PostgresExpress0.203s (-1.0%)1.000s (~)0.002s (-6.3% 🟢)1.010s (~)0.807s101.20x
💻 LocalNitro0.204s (-4.6%)1.004s (~)0.011s (-9.6% 🟢)1.018s (~)0.814s101.21x
🐘 PostgresNext.js (Turbopack)0.204s1.001s0.001s1.011s0.806s101.21x
💻 LocalExpress0.227s (+14.2% 🔺)1.004s (~)0.010s (-18.2% 🟢)1.016s (~)0.788s101.34x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.495s (-78.2% 🟢)2.793s (-67.7% 🟢)0.933s (+47.7% 🔺)4.135s (-57.8% 🟢)2.641s101.00x
▲ VercelExpress1.627s (-35.1% 🟢)3.231s (-21.0% 🟢)0.668s (-30.5% 🟢)4.341s (-22.3% 🟢)2.715s101.09x
▲ VercelNitro1.672s (-56.4% 🟢)2.805s (-46.8% 🟢)1.109s (+49.4% 🔺)4.338s (-33.1% 🟢)2.665s101.12x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.609s1.009s0.005s1.022s0.413s591.00x
🐘 PostgresExpress0.632s (~)1.021s (+1.4%)0.004s (+4.4%)1.042s (+1.8%)0.410s581.04x
💻 LocalNext.js (Turbopack)0.756s1.011s0.010s1.117s0.361s541.24x
💻 LocalNitro0.769s (-8.3% 🟢)1.012s (~)0.012s (+25.4% 🔺)1.026s (-8.1% 🟢)0.257s591.26x
💻 LocalExpress0.857s (+13.1% 🔺)1.012s (-1.7%)0.012s (+22.4% 🔺)1.118s (+7.5% 🔺)0.262s541.41x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.777s (-11.2% 🟢)7.473s (-6.7% 🟢)0.185s (-54.8% 🟢)8.112s (-8.2% 🟢)2.335s81.00x
▲ VercelNext.js (Turbopack)6.719s (-60.3% 🟢)8.047s (-55.9% 🟢)0.186s (-11.8% 🟢)8.612s (-54.5% 🟢)1.892s71.16x
▲ VercelNitro8.246s (-72.0% 🟢)9.624s (-68.8% 🟢)0.167s (+48.7% 🔺)10.158s (-68.0% 🟢)1.912s61.43x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.919s1.072s0.000s1.080s0.161s561.00x
🐘 PostgresExpress0.984s (+2.4%)1.301s (+1.8%)0.000s (~)1.328s (+1.7%)0.344s461.07x
💻 LocalExpress1.238s (+1.0%)2.020s (~)0.000s (+30.0% 🔺)2.022s (~)0.785s301.35x
💻 LocalNext.js (Turbopack)1.241s2.019s0.000s2.022s0.781s301.35x
💻 LocalNitro1.433s (+17.2% 🔺)2.023s (~)0.000s (+292.9% 🔺)2.204s (+9.0% 🔺)0.771s281.56x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.869s (-6.0% 🟢)4.073s (-7.3% 🟢)0.000s (-7.1% 🟢)4.417s (-8.2% 🟢)1.548s141.00x
▲ VercelExpress2.934s (-21.6% 🟢)4.316s (-15.4% 🟢)0.000s (-100.0% 🟢)4.733s (-14.4% 🟢)1.799s131.02x
▲ VercelNext.js (Turbopack)3.017s (-70.4% 🟢)4.293s (-62.7% 🟢)0.000s (+Infinity% 🔺)4.672s (-61.2% 🟢)1.655s141.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.793s (+1.2%)2.143s (-1.6%)0.000s (+Infinity% 🔺)2.152s (-2.1%)0.359s281.00x
🐘 PostgresNext.js (Turbopack)1.844s2.145s0.000s2.152s0.308s281.03x
💻 LocalNext.js (Turbopack)3.508s4.033s0.000s4.036s0.528s151.96x
💻 LocalExpress3.603s (+3.9%)4.101s (+1.7%)0.001s (-8.3% 🟢)4.105s (+1.7%)0.502s152.01x
💻 LocalNitro3.674s (+8.5% 🔺)4.164s (+3.3%)0.001s (~)4.167s (+3.2%)0.493s152.05x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.063s (-0.8%)5.253s (-2.2%)0.000s (-100.0% 🟢)5.588s (-3.5%)1.526s111.00x
▲ VercelExpress4.167s (-9.2% 🟢)5.682s (-5.6% 🟢)0.000s (NaN%)6.087s (-5.7% 🟢)1.920s111.03x
▲ VercelNext.js (Turbopack)4.455s (-20.7% 🟢)5.836s (-16.4% 🟢)0.000s (-100.0% 🟢)6.230s (-17.4% 🟢)1.774s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)14/21
🐘 PostgresNext.js (Turbopack)12/21
▲ VercelExpress9/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres16/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro💻 Local16/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)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

Comment thread.changeset/stream-cancel-propagation-main.md Outdated
Comment threadpackages/world-vercel/src/streamer.ts Outdated
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, well-scoped fix. Forward-port of #1801 for main. The approach — cancelled flag as the source of truth plus a single shared AbortController for the whole stream lifetime — is the right pattern for this class of bug.

What looks good

  • Cancellation checks at all the right points: before reader.read(), after reader.read() (covers the case where read completed naturally between abort and flag check), and before reconnect(). Combined with the AbortController plumbed into fetch, this covers all the race windows:

    • Cancel before any pull → initial reader gets cancelled, pull is never invoked
    • Cancel during active read → AbortError swallowed, exits cleanly
    • Cancel during reconnect → in-flight fetch aborted, caught, exits cleanly
    • Cancel between reconnect completion and next read → flag checked at top of loop
  • Shared AbortController across all reconnects is correct. Once aborted, it stays aborted, which means all future connect() calls abort instantly. Right primitive for whole-stream cancellation.

  • Reconnect try/catch properly distinguishes abort-from-cancel (return silently) vs. real errors (propagate via controller.error).

  • reader.cancel().catch() on the closure variable — the comment explicitly acknowledges the TOCTOU window and explains why the cancelled flag is the real guarantee. Good defense-in-depth comment.

  • Changeset correctly scoped to @workflow/world-vercel only.

Test coverage observations

The PR description calls out test 1 (aborts the in-flight upstream fetch via AbortSignal) as failing on main without the fix — I agree, that's the strongest test.

Tests 2 and 3 are more like documentation/regression guards than fix verifications:

  • Test 2 (does not reconnect after the consumer cancels mid-timeout): the test never calls read() after the first one, so pull is never re-invoked — no reconnect path is actually exercised. Pre-fix, fetchCount would also be 1 simply because there's no trigger for a second pull. To really exercise the race, the test would need to let pull enter the reconnect branch before cancel (e.g. drain all data + timeout frame before cancelling). That said, it's still useful as a guard against future regressions where someone might trigger reconnects asynchronously.
  • Test 3 (cancels the active reader when cancel is called during a read): WHATWG streams semantics already make reader.cancel() propagate to the upstream body reader, so this likely passed pre-fix too.

Not blocking — the primary fix is well-verified by test 1.

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

@VaguelySerious@TooTallNate
, '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('^' + ".*" + ' [world-vercel] Propagate cancel from streams.get to upstream fetch by VaguelySerious · Pull Request #1802 · vercel/workflow · GitHub
Skip to content

[world-vercel] Propagate cancel from streams.get to upstream fetch - #1802

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main
Closed

[world-vercel] Propagate cancel from streams.get to upstream fetch#1802
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

Forward-port of #1801 onto main. Same class of bug, different function shape (streams.get(runId, name, startIndex) here vs. readFromStream(name, startIndex) on stable).

When a consumer cancels the ReadableStream returned by streams.get() (e.g. an HTTP client disconnects from an API route that pipes run.getReadable()), the pull loop in the streamer kept running and could trigger further reconnects in the background. The in-flight upstream fetch was never aborted, so the endpoint kept fetching long after the client had gone away.

Root cause

  1. No cancelled flag — pull had no way to know the consumer asked to stop.
  2. No AbortSignal on the upstream fetch() — even if we noticed, there was no way to unblock a pending request.

The cancel handler only called reader.cancel() on whichever reader was captured at that moment. If pull was mid-reconnect (reader = await connect()), cancel cancelled the stale reader; the new fetch then connected and kept streaming.

Fix

  • Track a cancelled flag that pull checks before and after each reader.read() and before each connect().
  • Plumb an AbortController.signal into fetch, aborted from cancel, so the in-flight request (including a pending reconnect) unblocks.
  • connect() failures triggered by abort are swallowed silently when cancelled.

Tests

Three new tests under a new streams.get consumer cancel describe block:

  • aborts the in-flight upstream fetch via AbortSignal — fails on main without the fix; asserts fetch was called with an AbortSignal and that the signal is aborted after stream.cancel().
  • does not reconnect after the consumer cancels mid-timeout — documents that no further fetch is initiated after cancel.
  • cancels the active reader when cancel is called during a read — documents that cancel unblocks a pending reader.read().

All 32 world-vercel streamer tests pass locally.

Companion

Test plan

  • pnpm vitest run — all world-vercel tests pass
  • Typecheck clean
  • CI + workflow-server auto e2e

🤖 Generated with Claude Code

When a consumer cancels the ReadableStream returned by streams.get
(e.g. an HTTP client hanging up on an endpoint that pipes
`run.getReadable()`), the pull loop could continue running and even
trigger a fresh reconnect via `connect()` — the new fetch was never
tied to the cancellation, so the request kept running in the
background.
Fix:
- Track a `cancelled` flag that `pull` checks before and after each
read and before each reconnect.
- Plumb an `AbortController.signal` into `fetch` so the in-flight
upstream request (including a pending reconnect) is aborted when
the consumer cancels.
Regression tests cover the abort-signal contract, the mid-timeout
reconnect race, and cancel-during-read.
Port of #1801 (targeting `stable`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9de9271

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

This PR includes changesets to release 18 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/aiPatch
@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 Apr 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9450671012
❌ 💻 Local Development10171861104
✅ 📦 Local Production10180861104
✅ 🐘 Local Postgres10180861104
✅ 📋 Other258018276
Total425613434600

❌ Failed Tests

💻 Local Development (1 failed)

vite-stable (1 failed):

  • hookWorkflow | wrun_01KPEF76M376DM0WQEFASYBKMY

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8507
✅ example8507
✅ express8507
✅ fastify8507
✅ hono8507
✅ nextjs-turbopack9002
✅ nextjs-webpack9002
✅ nitro8507
✅ nuxt8507
✅ sveltekit8507
✅ vite8507
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
❌ vite-stable8516
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8606
✅ e2e-local-postgres-nest-stable8606
✅ e2e-local-prod-nest-stable8606

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 17, 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.044s (+1.4%)1.005s (~)0.962s101.00x
💻 LocalExpress0.044s (-0.9%)1.005s (~)0.961s101.00x
💻 LocalNext.js (Turbopack)0.048s1.005s0.957s101.09x
🐘 PostgresExpress0.057s (-2.1%)1.011s (~)0.955s101.30x
🐘 PostgresNext.js (Turbopack)0.058s1.009s0.951s101.33x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.215s (-8.6% 🟢)1.900s (-11.0% 🟢)1.685s101.00x
▲ VercelNitro0.254s (-38.0% 🟢)1.794s (-28.5% 🟢)1.540s101.18x
▲ VercelNext.js (Turbopack)0.264s (+5.1% 🔺)2.153s (-7.7% 🟢)1.889s101.23x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.123s2.005s0.882s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.878s101.00x
💻 LocalExpress1.129s (~)2.005s (~)0.876s101.00x
🐘 PostgresNext.js (Turbopack)1.139s2.009s0.870s101.01x
🐘 PostgresExpress1.153s (+0.5%)2.010s (~)0.857s101.03x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.945s (+3.7%)3.789s (~)1.844s101.00x
▲ VercelNext.js (Turbopack)2.087s (+2.5%)3.450s (-9.9% 🟢)1.363s101.07x
▲ VercelNitro2.112s (-45.7% 🟢)3.337s (-43.5% 🟢)1.225s101.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.778s11.022s0.245s31.00x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.01x
💻 LocalExpress10.927s (~)11.023s (~)0.097s31.01x
🐘 PostgresNext.js (Turbopack)10.939s11.020s0.082s31.01x
💻 LocalNitro10.942s (~)11.023s (~)0.081s31.02x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)19.107s (+10.3% 🔺)20.648s (+6.4% 🔺)1.542s21.00x
▲ VercelExpress20.625s (+21.5% 🔺)22.950s (+14.6% 🔺)2.326s21.08x
▲ VercelNitro22.424s (-5.5% 🟢)24.009s (-4.4%)1.585s21.17x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.499s15.020s0.520s41.00x
💻 LocalNext.js (Turbopack)14.627s15.029s0.402s41.01x
🐘 PostgresExpress14.633s (~)15.025s (~)0.392s41.01x
💻 LocalNitro14.994s (~)15.280s (-4.7%)0.286s41.03x
💻 LocalExpress15.033s (~)15.280s (+1.7%)0.247s41.04x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.730s (-36.9% 🟢)33.288s (-36.7% 🟢)1.558s21.00x
▲ VercelNitro32.513s (-49.6% 🟢)33.549s (-49.6% 🟢)1.037s21.02x
▲ VercelNext.js (Turbopack)34.645s (-34.1% 🟢)36.196s (-33.7% 🟢)1.551s21.09x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.972s (~)14.310s (-1.9%)0.338s71.00x
🐘 PostgresNext.js (Turbopack)13.996s14.306s0.310s71.00x
💻 LocalNext.js (Turbopack)16.008s16.363s0.354s61.15x
💻 LocalNitro16.765s (~)17.031s (~)0.266s61.20x
💻 LocalExpress16.821s (+1.3%)17.199s (+1.0%)0.378s61.20x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express55.760s (-54.0% 🟢)57.850s (-53.2% 🟢)2.090s21.00x
▲ VercelNext.js (Turbopack)58.773s (-85.1% 🟢)60.892s (-84.6% 🟢)2.119s21.05x
▲ VercelNitro58.992s (-86.1% 🟢)59.843s (-85.9% 🟢)0.852s21.06x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.237s2.009s0.771s151.00x
🐘 PostgresExpress1.271s (+0.8%)2.010s (~)0.739s151.03x
💻 LocalNext.js (Turbopack)1.565s2.073s0.508s151.26x
💻 LocalNitro1.569s (-3.8%)2.006s (-3.3%)0.438s151.27x
💻 LocalExpress1.591s (+6.9% 🔺)2.072s (+3.3%)0.481s151.29x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.177s (-23.9% 🟢)3.957s (-14.4% 🟢)1.780s81.00x
▲ VercelNitro2.266s (-19.6% 🟢)3.575s (-17.3% 🟢)1.309s91.04x
▲ VercelNext.js (Turbopack)2.491s (-26.7% 🟢)3.966s (-19.6% 🟢)1.475s81.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.326s (-1.5%)3.008s (~)0.682s101.00x
🐘 PostgresNext.js (Turbopack)2.414s3.009s0.595s101.04x
💻 LocalExpress2.853s (-3.4%)3.209s (-7.1% 🟢)0.355s101.23x
💻 LocalNext.js (Turbopack)2.870s3.109s0.239s101.23x
💻 LocalNitro3.075s (-2.2%)3.676s (-5.4% 🟢)0.602s91.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.427s (-40.1% 🟢)3.659s (-38.2% 🟢)1.232s91.00x
▲ VercelExpress2.597s (-28.2% 🟢)3.934s (-23.0% 🟢)1.337s81.07x
▲ VercelNext.js (Turbopack)2.605s (-63.3% 🟢)4.047s (-54.6% 🟢)1.442s81.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.487s (~)4.009s (~)0.522s81.00x
🐘 PostgresNext.js (Turbopack)3.660s4.010s0.350s81.05x
💻 LocalNext.js (Turbopack)7.234s7.765s0.532s42.07x
💻 LocalExpress7.298s (-12.5% 🟢)8.019s (-11.2% 🟢)0.721s42.09x
💻 LocalNitro8.550s (+2.4%)9.025s (~)0.475s42.45x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.074s (-12.8% 🟢)4.414s (-20.2% 🟢)1.340s81.00x
▲ VercelExpress3.138s (-26.0% 🟢)5.027s (-18.0% 🟢)1.889s71.02x
▲ VercelNext.js (Turbopack)4.736s (-46.9% 🟢)6.298s (-42.5% 🟢)1.562s51.54x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.235s2.009s0.774s151.00x
🐘 PostgresExpress1.264s (+0.5%)2.007s (~)0.744s151.02x
💻 LocalNext.js (Turbopack)1.508s2.005s0.497s151.22x
💻 LocalExpress1.517s (-19.9% 🟢)2.006s (-15.1% 🟢)0.489s151.23x
💻 LocalNitro1.557s (-16.5% 🟢)2.006s (-14.3% 🟢)0.449s151.26x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.144s (-16.9% 🟢)4.110s (-5.5% 🟢)1.966s81.00x
▲ VercelNext.js (Turbopack)2.156s (-26.5% 🟢)3.524s (-24.1% 🟢)1.368s91.01x
▲ VercelNitro2.427s (-1.3%)3.595s (-13.8% 🟢)1.168s91.13x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.352s (~)3.009s (~)0.657s101.00x
🐘 PostgresNext.js (Turbopack)2.387s3.009s0.622s101.01x
💻 LocalExpress2.940s (-6.1% 🟢)3.341s (-11.2% 🟢)0.401s91.25x
💻 LocalNext.js (Turbopack)2.961s3.760s0.799s81.26x
💻 LocalNitro3.055s (~)3.759s (-3.3%)0.704s81.30x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.296s (-28.1% 🟢)3.931s (-18.0% 🟢)1.635s81.00x
▲ VercelNitro2.679s (-17.1% 🟢)3.957s (-22.1% 🟢)1.277s91.17x
▲ VercelNext.js (Turbopack)2.758s (-12.2% 🟢)4.045s (-10.5% 🟢)1.287s81.20x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.489s (~)4.011s (~)0.521s81.00x
🐘 PostgresNext.js (Turbopack)3.668s4.010s0.341s81.05x
💻 LocalExpress7.974s (-9.4% 🟢)8.524s (-8.1% 🟢)0.549s42.29x
💻 LocalNext.js (Turbopack)8.849s9.524s0.675s42.54x
💻 LocalNitro9.056s (-1.0%)9.523s (-5.0% 🟢)0.467s42.60x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.854s (-44.0% 🟢)4.359s (-36.1% 🟢)1.505s71.00x
▲ VercelExpress2.952s (-54.0% 🟢)4.606s (-43.7% 🟢)1.655s71.03x
▲ VercelNext.js (Turbopack)3.820s (-43.5% 🟢)5.366s (-37.2% 🟢)1.546s61.34x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.778s1.023s0.244s591.00x
🐘 PostgresExpress0.822s (-2.1%)1.006s (-1.6%)0.185s601.06x
💻 LocalNext.js (Turbopack)0.844s1.004s0.160s601.08x
💻 LocalExpress1.013s (+3.0%)1.672s (+55.4% 🔺)0.659s361.30x
💻 LocalNitro1.026s (+4.7%)1.800s (+64.6% 🔺)0.774s341.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)9.041s (-37.7% 🟢)10.605s (-34.1% 🟢)1.564s61.00x
▲ VercelNitro9.167s (-58.4% 🟢)10.774s (-55.2% 🟢)1.608s61.01x
▲ VercelExpress9.420s (-50.5% 🟢)10.934s (-48.7% 🟢)1.514s61.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.908s2.124s0.216s431.00x
🐘 PostgresExpress1.976s (~)2.258s (~)0.282s401.04x
💻 LocalNext.js (Turbopack)2.641s3.007s0.366s301.38x
💻 LocalExpress3.022s (~)3.689s (+2.9%)0.667s251.58x
💻 LocalNitro3.063s (+0.9%)3.922s (+4.4%)0.859s231.61x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)28.897s (-42.0% 🟢)30.300s (-41.4% 🟢)1.404s31.00x
▲ VercelNitro29.540s (-25.2% 🟢)31.066s (-24.8% 🟢)1.525s31.02x
▲ VercelExpress29.717s (-13.9% 🟢)31.535s (-14.3% 🟢)1.818s31.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.867s4.010s0.143s301.00x
🐘 PostgresExpress4.012s (+0.5%)4.493s (+2.8%)0.482s271.04x
💻 LocalNext.js (Turbopack)8.486s9.017s0.531s142.19x
💻 LocalExpress9.064s (-1.6%)9.478s (-5.4% 🟢)0.414s132.34x
💻 LocalNitro9.278s (~)9.942s (-0.8%)0.664s132.40x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro71.447s (-26.3% 🟢)73.075s (-25.8% 🟢)1.628s21.00x
▲ VercelExpress72.056s (-44.6% 🟢)73.881s (-44.1% 🟢)1.825s21.01x
▲ VercelNext.js (Turbopack)74.567s (-30.4% 🟢)76.256s (-30.0% 🟢)1.690s21.04x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.249s1.007s0.758s601.00x
🐘 PostgresExpress0.289s (+2.3%)1.007s (~)0.718s601.16x
💻 LocalNext.js (Turbopack)0.544s1.004s0.461s602.19x
💻 LocalNitro0.592s (-2.1%)1.022s (~)0.430s592.38x
💻 LocalExpress0.604s (+7.8% 🔺)1.021s (+1.7%)0.417s592.43x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.416s (-27.6% 🟢)2.982s (-18.0% 🟢)1.567s211.00x
▲ VercelNitro1.604s (-3.4%)2.969s (-11.4% 🟢)1.365s211.13x
▲ VercelNext.js (Turbopack)1.608s (-20.5% 🟢)3.112s (-18.0% 🟢)1.504s201.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s1.006s0.520s901.00x
🐘 PostgresExpress0.501s (-1.7%)1.007s (~)0.506s901.03x
💻 LocalExpress2.376s (-5.5% 🟢)3.008s (~)0.632s304.89x
💻 LocalNext.js (Turbopack)2.525s3.009s0.484s305.20x
💻 LocalNitro2.585s (+1.9%)3.009s (~)0.424s305.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.851s (-11.6% 🟢)4.168s (-13.5% 🟢)1.317s221.00x
▲ VercelExpress2.858s (-6.2% 🟢)4.555s (-5.2% 🟢)1.697s201.00x
▲ VercelNext.js (Turbopack)3.341s (-5.5% 🟢)4.972s (-4.3%)1.631s191.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.781s1.007s0.225s1201.00x
🐘 PostgresExpress0.822s (~)1.010s (-0.7%)0.188s1191.05x
💻 LocalExpress10.571s (-5.5% 🟢)11.027s (-7.7% 🟢)0.456s1113.53x
💻 LocalNext.js (Turbopack)10.643s11.207s0.564s1113.63x
💻 LocalNitro11.261s (+0.6%)11.848s (+1.6%)0.587s1114.42x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.395s (-28.4% 🟢)9.144s (-25.6% 🟢)1.748s141.00x
▲ VercelExpress7.507s (+1.2%)9.507s (+2.8%)2.000s131.02x
▲ VercelNitro7.762s (+0.5%)9.268s (-1.4%)1.505s131.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.169s1.003s0.012s1.018s0.848s101.00x
🐘 PostgresExpress0.203s (-1.0%)1.000s (~)0.002s (-6.3% 🟢)1.010s (~)0.807s101.20x
💻 LocalNitro0.204s (-4.6%)1.004s (~)0.011s (-9.6% 🟢)1.018s (~)0.814s101.21x
🐘 PostgresNext.js (Turbopack)0.204s1.001s0.001s1.011s0.806s101.21x
💻 LocalExpress0.227s (+14.2% 🔺)1.004s (~)0.010s (-18.2% 🟢)1.016s (~)0.788s101.34x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.495s (-78.2% 🟢)2.793s (-67.7% 🟢)0.933s (+47.7% 🔺)4.135s (-57.8% 🟢)2.641s101.00x
▲ VercelExpress1.627s (-35.1% 🟢)3.231s (-21.0% 🟢)0.668s (-30.5% 🟢)4.341s (-22.3% 🟢)2.715s101.09x
▲ VercelNitro1.672s (-56.4% 🟢)2.805s (-46.8% 🟢)1.109s (+49.4% 🔺)4.338s (-33.1% 🟢)2.665s101.12x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.609s1.009s0.005s1.022s0.413s591.00x
🐘 PostgresExpress0.632s (~)1.021s (+1.4%)0.004s (+4.4%)1.042s (+1.8%)0.410s581.04x
💻 LocalNext.js (Turbopack)0.756s1.011s0.010s1.117s0.361s541.24x
💻 LocalNitro0.769s (-8.3% 🟢)1.012s (~)0.012s (+25.4% 🔺)1.026s (-8.1% 🟢)0.257s591.26x
💻 LocalExpress0.857s (+13.1% 🔺)1.012s (-1.7%)0.012s (+22.4% 🔺)1.118s (+7.5% 🔺)0.262s541.41x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.777s (-11.2% 🟢)7.473s (-6.7% 🟢)0.185s (-54.8% 🟢)8.112s (-8.2% 🟢)2.335s81.00x
▲ VercelNext.js (Turbopack)6.719s (-60.3% 🟢)8.047s (-55.9% 🟢)0.186s (-11.8% 🟢)8.612s (-54.5% 🟢)1.892s71.16x
▲ VercelNitro8.246s (-72.0% 🟢)9.624s (-68.8% 🟢)0.167s (+48.7% 🔺)10.158s (-68.0% 🟢)1.912s61.43x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.919s1.072s0.000s1.080s0.161s561.00x
🐘 PostgresExpress0.984s (+2.4%)1.301s (+1.8%)0.000s (~)1.328s (+1.7%)0.344s461.07x
💻 LocalExpress1.238s (+1.0%)2.020s (~)0.000s (+30.0% 🔺)2.022s (~)0.785s301.35x
💻 LocalNext.js (Turbopack)1.241s2.019s0.000s2.022s0.781s301.35x
💻 LocalNitro1.433s (+17.2% 🔺)2.023s (~)0.000s (+292.9% 🔺)2.204s (+9.0% 🔺)0.771s281.56x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.869s (-6.0% 🟢)4.073s (-7.3% 🟢)0.000s (-7.1% 🟢)4.417s (-8.2% 🟢)1.548s141.00x
▲ VercelExpress2.934s (-21.6% 🟢)4.316s (-15.4% 🟢)0.000s (-100.0% 🟢)4.733s (-14.4% 🟢)1.799s131.02x
▲ VercelNext.js (Turbopack)3.017s (-70.4% 🟢)4.293s (-62.7% 🟢)0.000s (+Infinity% 🔺)4.672s (-61.2% 🟢)1.655s141.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.793s (+1.2%)2.143s (-1.6%)0.000s (+Infinity% 🔺)2.152s (-2.1%)0.359s281.00x
🐘 PostgresNext.js (Turbopack)1.844s2.145s0.000s2.152s0.308s281.03x
💻 LocalNext.js (Turbopack)3.508s4.033s0.000s4.036s0.528s151.96x
💻 LocalExpress3.603s (+3.9%)4.101s (+1.7%)0.001s (-8.3% 🟢)4.105s (+1.7%)0.502s152.01x
💻 LocalNitro3.674s (+8.5% 🔺)4.164s (+3.3%)0.001s (~)4.167s (+3.2%)0.493s152.05x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.063s (-0.8%)5.253s (-2.2%)0.000s (-100.0% 🟢)5.588s (-3.5%)1.526s111.00x
▲ VercelExpress4.167s (-9.2% 🟢)5.682s (-5.6% 🟢)0.000s (NaN%)6.087s (-5.7% 🟢)1.920s111.03x
▲ VercelNext.js (Turbopack)4.455s (-20.7% 🟢)5.836s (-16.4% 🟢)0.000s (-100.0% 🟢)6.230s (-17.4% 🟢)1.774s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)14/21
🐘 PostgresNext.js (Turbopack)12/21
▲ VercelExpress9/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres16/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro💻 Local16/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)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

Comment thread.changeset/stream-cancel-propagation-main.md Outdated
Comment threadpackages/world-vercel/src/streamer.ts Outdated
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, well-scoped fix. Forward-port of #1801 for main. The approach — cancelled flag as the source of truth plus a single shared AbortController for the whole stream lifetime — is the right pattern for this class of bug.

What looks good

  • Cancellation checks at all the right points: before reader.read(), after reader.read() (covers the case where read completed naturally between abort and flag check), and before reconnect(). Combined with the AbortController plumbed into fetch, this covers all the race windows:

    • Cancel before any pull → initial reader gets cancelled, pull is never invoked
    • Cancel during active read → AbortError swallowed, exits cleanly
    • Cancel during reconnect → in-flight fetch aborted, caught, exits cleanly
    • Cancel between reconnect completion and next read → flag checked at top of loop
  • Shared AbortController across all reconnects is correct. Once aborted, it stays aborted, which means all future connect() calls abort instantly. Right primitive for whole-stream cancellation.

  • Reconnect try/catch properly distinguishes abort-from-cancel (return silently) vs. real errors (propagate via controller.error).

  • reader.cancel().catch() on the closure variable — the comment explicitly acknowledges the TOCTOU window and explains why the cancelled flag is the real guarantee. Good defense-in-depth comment.

  • Changeset correctly scoped to @workflow/world-vercel only.

Test coverage observations

The PR description calls out test 1 (aborts the in-flight upstream fetch via AbortSignal) as failing on main without the fix — I agree, that's the strongest test.

Tests 2 and 3 are more like documentation/regression guards than fix verifications:

  • Test 2 (does not reconnect after the consumer cancels mid-timeout): the test never calls read() after the first one, so pull is never re-invoked — no reconnect path is actually exercised. Pre-fix, fetchCount would also be 1 simply because there's no trigger for a second pull. To really exercise the race, the test would need to let pull enter the reconnect branch before cancel (e.g. drain all data + timeout frame before cancelling). That said, it's still useful as a guard against future regressions where someone might trigger reconnects asynchronously.
  • Test 3 (cancels the active reader when cancel is called during a read): WHATWG streams semantics already make reader.cancel() propagate to the upstream body reader, so this likely passed pre-fix too.

Not blocking — the primary fix is well-verified by test 1.

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

@VaguelySerious@TooTallNate
, '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); } })(); })(); [world-vercel] Propagate cancel from streams.get to upstream fetch by VaguelySerious · Pull Request #1802 · vercel/workflow · GitHub
Skip to content

[world-vercel] Propagate cancel from streams.get to upstream fetch - #1802

Closed
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main
Closed

[world-vercel] Propagate cancel from streams.get to upstream fetch#1802
VaguelySerious wants to merge 2 commits into
mainfrom
peter/fix-stream-cancel-reconnect-main

Conversation

@VaguelySerious

Copy link
Copy Markdown
Member

Summary

Forward-port of #1801 onto main. Same class of bug, different function shape (streams.get(runId, name, startIndex) here vs. readFromStream(name, startIndex) on stable).

When a consumer cancels the ReadableStream returned by streams.get() (e.g. an HTTP client disconnects from an API route that pipes run.getReadable()), the pull loop in the streamer kept running and could trigger further reconnects in the background. The in-flight upstream fetch was never aborted, so the endpoint kept fetching long after the client had gone away.

Root cause

  1. No cancelled flag — pull had no way to know the consumer asked to stop.
  2. No AbortSignal on the upstream fetch() — even if we noticed, there was no way to unblock a pending request.

The cancel handler only called reader.cancel() on whichever reader was captured at that moment. If pull was mid-reconnect (reader = await connect()), cancel cancelled the stale reader; the new fetch then connected and kept streaming.

Fix

  • Track a cancelled flag that pull checks before and after each reader.read() and before each connect().
  • Plumb an AbortController.signal into fetch, aborted from cancel, so the in-flight request (including a pending reconnect) unblocks.
  • connect() failures triggered by abort are swallowed silently when cancelled.

Tests

Three new tests under a new streams.get consumer cancel describe block:

  • aborts the in-flight upstream fetch via AbortSignal — fails on main without the fix; asserts fetch was called with an AbortSignal and that the signal is aborted after stream.cancel().
  • does not reconnect after the consumer cancels mid-timeout — documents that no further fetch is initiated after cancel.
  • cancels the active reader when cancel is called during a read — documents that cancel unblocks a pending reader.read().

All 32 world-vercel streamer tests pass locally.

Companion

Test plan

  • pnpm vitest run — all world-vercel tests pass
  • Typecheck clean
  • CI + workflow-server auto e2e

🤖 Generated with Claude Code

When a consumer cancels the ReadableStream returned by streams.get
(e.g. an HTTP client hanging up on an endpoint that pipes
`run.getReadable()`), the pull loop could continue running and even
trigger a fresh reconnect via `connect()` — the new fetch was never
tied to the cancellation, so the request kept running in the
background.
Fix:
- Track a `cancelled` flag that `pull` checks before and after each
read and before each reconnect.
- Plumb an `AbortController.signal` into `fetch` so the in-flight
upstream request (including a pending reconnect) is aborted when
the consumer cancels.
Regression tests cover the abort-signal contract, the mid-timeout
reconnect race, and cancel-during-read.
Port of #1801 (targeting `stable`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>
@changeset-bot

changeset-botBot commented Apr 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9de9271

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

This PR includes changesets to release 18 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/aiPatch
@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 Apr 17, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actionsBot commented Apr 17, 2026

Copy link
Copy Markdown
Contributor

🧪 E2E Test Results

Some tests failed

Summary

PassedFailedSkippedTotal
✅ ▲ Vercel Production9450671012
❌ 💻 Local Development10171861104
✅ 📦 Local Production10180861104
✅ 🐘 Local Postgres10180861104
✅ 📋 Other258018276
Total425613434600

❌ Failed Tests

💻 Local Development (1 failed)

vite-stable (1 failed):

  • hookWorkflow | wrun_01KPEF76M376DM0WQEFASYBKMY

Details by Category

✅ ▲ Vercel Production
AppPassedFailedSkipped
✅ astro8507
✅ example8507
✅ express8507
✅ fastify8507
✅ hono8507
✅ nextjs-turbopack9002
✅ nextjs-webpack9002
✅ nitro8507
✅ nuxt8507
✅ sveltekit8507
✅ vite8507
❌ 💻 Local Development
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
❌ vite-stable8516
✅ 📦 Local Production
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 🐘 Local Postgres
AppPassedFailedSkipped
✅ astro-stable8606
✅ express-stable8606
✅ fastify-stable8606
✅ hono-stable8606
✅ nextjs-turbopack-canary73019
✅ nextjs-turbopack-stable9200
✅ nextjs-webpack-canary73019
✅ nextjs-webpack-stable9200
✅ nitro-stable8606
✅ nuxt-stable8606
✅ sveltekit-stable8606
✅ vite-stable8606
✅ 📋 Other
AppPassedFailedSkipped
✅ e2e-local-dev-nest-stable8606
✅ e2e-local-postgres-nest-stable8606
✅ e2e-local-prod-nest-stable8606

📋 View full workflow run


Some E2E test jobs failed:

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

Check the workflow run for details.

@github-actions

github-actionsBot commented Apr 17, 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.044s (+1.4%)1.005s (~)0.962s101.00x
💻 LocalExpress0.044s (-0.9%)1.005s (~)0.961s101.00x
💻 LocalNext.js (Turbopack)0.048s1.005s0.957s101.09x
🐘 PostgresExpress0.057s (-2.1%)1.011s (~)0.955s101.30x
🐘 PostgresNext.js (Turbopack)0.058s1.009s0.951s101.33x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express0.215s (-8.6% 🟢)1.900s (-11.0% 🟢)1.685s101.00x
▲ VercelNitro0.254s (-38.0% 🟢)1.794s (-28.5% 🟢)1.540s101.18x
▲ VercelNext.js (Turbopack)0.264s (+5.1% 🔺)2.153s (-7.7% 🟢)1.889s101.23x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 1 step

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)1.123s2.005s0.882s101.00x
💻 LocalNitro1.128s (~)2.006s (~)0.878s101.00x
💻 LocalExpress1.129s (~)2.005s (~)0.876s101.00x
🐘 PostgresNext.js (Turbopack)1.139s2.009s0.870s101.01x
🐘 PostgresExpress1.153s (+0.5%)2.010s (~)0.857s101.03x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.945s (+3.7%)3.789s (~)1.844s101.00x
▲ VercelNext.js (Turbopack)2.087s (+2.5%)3.450s (-9.9% 🟢)1.363s101.07x
▲ VercelNitro2.112s (-45.7% 🟢)3.337s (-43.5% 🟢)1.225s101.09x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

workflow with 10 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)10.778s11.022s0.245s31.00x
🐘 PostgresExpress10.871s (-0.8%)11.023s (~)0.152s31.01x
💻 LocalExpress10.927s (~)11.023s (~)0.097s31.01x
🐘 PostgresNext.js (Turbopack)10.939s11.020s0.082s31.01x
💻 LocalNitro10.942s (~)11.023s (~)0.081s31.02x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)19.107s (+10.3% 🔺)20.648s (+6.4% 🔺)1.542s21.00x
▲ VercelExpress20.625s (+21.5% 🔺)22.950s (+14.6% 🔺)2.326s21.08x
▲ VercelNitro22.424s (-5.5% 🟢)24.009s (-4.4%)1.585s21.17x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

workflow with 25 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)14.499s15.020s0.520s41.00x
💻 LocalNext.js (Turbopack)14.627s15.029s0.402s41.01x
🐘 PostgresExpress14.633s (~)15.025s (~)0.392s41.01x
💻 LocalNitro14.994s (~)15.280s (-4.7%)0.286s41.03x
💻 LocalExpress15.033s (~)15.280s (+1.7%)0.247s41.04x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express31.730s (-36.9% 🟢)33.288s (-36.7% 🟢)1.558s21.00x
▲ VercelNitro32.513s (-49.6% 🟢)33.549s (-49.6% 🟢)1.037s21.02x
▲ VercelNext.js (Turbopack)34.645s (-34.1% 🟢)36.196s (-33.7% 🟢)1.551s21.09x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 50 sequential steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express13.972s (~)14.310s (-1.9%)0.338s71.00x
🐘 PostgresNext.js (Turbopack)13.996s14.306s0.310s71.00x
💻 LocalNext.js (Turbopack)16.008s16.363s0.354s61.15x
💻 LocalNitro16.765s (~)17.031s (~)0.266s61.20x
💻 LocalExpress16.821s (+1.3%)17.199s (+1.0%)0.378s61.20x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express55.760s (-54.0% 🟢)57.850s (-53.2% 🟢)2.090s21.00x
▲ VercelNext.js (Turbopack)58.773s (-85.1% 🟢)60.892s (-84.6% 🟢)2.119s21.05x
▲ VercelNitro58.992s (-86.1% 🟢)59.843s (-85.9% 🟢)0.852s21.06x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.all with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.237s2.009s0.771s151.00x
🐘 PostgresExpress1.271s (+0.8%)2.010s (~)0.739s151.03x
💻 LocalNext.js (Turbopack)1.565s2.073s0.508s151.26x
💻 LocalNitro1.569s (-3.8%)2.006s (-3.3%)0.438s151.27x
💻 LocalExpress1.591s (+6.9% 🔺)2.072s (+3.3%)0.481s151.29x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.177s (-23.9% 🟢)3.957s (-14.4% 🟢)1.780s81.00x
▲ VercelNitro2.266s (-19.6% 🟢)3.575s (-17.3% 🟢)1.309s91.04x
▲ VercelNext.js (Turbopack)2.491s (-26.7% 🟢)3.966s (-19.6% 🟢)1.475s81.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.all with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.326s (-1.5%)3.008s (~)0.682s101.00x
🐘 PostgresNext.js (Turbopack)2.414s3.009s0.595s101.04x
💻 LocalExpress2.853s (-3.4%)3.209s (-7.1% 🟢)0.355s101.23x
💻 LocalNext.js (Turbopack)2.870s3.109s0.239s101.23x
💻 LocalNitro3.075s (-2.2%)3.676s (-5.4% 🟢)0.602s91.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.427s (-40.1% 🟢)3.659s (-38.2% 🟢)1.232s91.00x
▲ VercelExpress2.597s (-28.2% 🟢)3.934s (-23.0% 🟢)1.337s81.07x
▲ VercelNext.js (Turbopack)2.605s (-63.3% 🟢)4.047s (-54.6% 🟢)1.442s81.07x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.all with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.487s (~)4.009s (~)0.522s81.00x
🐘 PostgresNext.js (Turbopack)3.660s4.010s0.350s81.05x
💻 LocalNext.js (Turbopack)7.234s7.765s0.532s42.07x
💻 LocalExpress7.298s (-12.5% 🟢)8.019s (-11.2% 🟢)0.721s42.09x
💻 LocalNitro8.550s (+2.4%)9.025s (~)0.475s42.45x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro3.074s (-12.8% 🟢)4.414s (-20.2% 🟢)1.340s81.00x
▲ VercelExpress3.138s (-26.0% 🟢)5.027s (-18.0% 🟢)1.889s71.02x
▲ VercelNext.js (Turbopack)4.736s (-46.9% 🟢)6.298s (-42.5% 🟢)1.562s51.54x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Promise.race with 10 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.235s2.009s0.774s151.00x
🐘 PostgresExpress1.264s (+0.5%)2.007s (~)0.744s151.02x
💻 LocalNext.js (Turbopack)1.508s2.005s0.497s151.22x
💻 LocalExpress1.517s (-19.9% 🟢)2.006s (-15.1% 🟢)0.489s151.23x
💻 LocalNitro1.557s (-16.5% 🟢)2.006s (-14.3% 🟢)0.449s151.26x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.144s (-16.9% 🟢)4.110s (-5.5% 🟢)1.966s81.00x
▲ VercelNext.js (Turbopack)2.156s (-26.5% 🟢)3.524s (-24.1% 🟢)1.368s91.01x
▲ VercelNitro2.427s (-1.3%)3.595s (-13.8% 🟢)1.168s91.13x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

Promise.race with 25 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express2.352s (~)3.009s (~)0.657s101.00x
🐘 PostgresNext.js (Turbopack)2.387s3.009s0.622s101.01x
💻 LocalExpress2.940s (-6.1% 🟢)3.341s (-11.2% 🟢)0.401s91.25x
💻 LocalNext.js (Turbopack)2.961s3.760s0.799s81.26x
💻 LocalNitro3.055s (~)3.759s (-3.3%)0.704s81.30x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express2.296s (-28.1% 🟢)3.931s (-18.0% 🟢)1.635s81.00x
▲ VercelNitro2.679s (-17.1% 🟢)3.957s (-22.1% 🟢)1.277s91.17x
▲ VercelNext.js (Turbopack)2.758s (-12.2% 🟢)4.045s (-10.5% 🟢)1.287s81.20x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

Promise.race with 50 concurrent steps

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express3.489s (~)4.011s (~)0.521s81.00x
🐘 PostgresNext.js (Turbopack)3.668s4.010s0.341s81.05x
💻 LocalExpress7.974s (-9.4% 🟢)8.524s (-8.1% 🟢)0.549s42.29x
💻 LocalNext.js (Turbopack)8.849s9.524s0.675s42.54x
💻 LocalNitro9.056s (-1.0%)9.523s (-5.0% 🟢)0.467s42.60x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.854s (-44.0% 🟢)4.359s (-36.1% 🟢)1.505s71.00x
▲ VercelExpress2.952s (-54.0% 🟢)4.606s (-43.7% 🟢)1.655s71.03x
▲ VercelNext.js (Turbopack)3.820s (-43.5% 🟢)5.366s (-37.2% 🟢)1.546s61.34x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.778s1.023s0.244s591.00x
🐘 PostgresExpress0.822s (-2.1%)1.006s (-1.6%)0.185s601.06x
💻 LocalNext.js (Turbopack)0.844s1.004s0.160s601.08x
💻 LocalExpress1.013s (+3.0%)1.672s (+55.4% 🔺)0.659s361.30x
💻 LocalNitro1.026s (+4.7%)1.800s (+64.6% 🔺)0.774s341.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)9.041s (-37.7% 🟢)10.605s (-34.1% 🟢)1.564s61.00x
▲ VercelNitro9.167s (-58.4% 🟢)10.774s (-55.2% 🟢)1.608s61.01x
▲ VercelExpress9.420s (-50.5% 🟢)10.934s (-48.7% 🟢)1.514s61.04x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 25 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)1.908s2.124s0.216s431.00x
🐘 PostgresExpress1.976s (~)2.258s (~)0.282s401.04x
💻 LocalNext.js (Turbopack)2.641s3.007s0.366s301.38x
💻 LocalExpress3.022s (~)3.689s (+2.9%)0.667s251.58x
💻 LocalNitro3.063s (+0.9%)3.922s (+4.4%)0.859s231.61x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)28.897s (-42.0% 🟢)30.300s (-41.4% 🟢)1.404s31.00x
▲ VercelNitro29.540s (-25.2% 🟢)31.066s (-24.8% 🟢)1.525s31.02x
▲ VercelExpress29.717s (-13.9% 🟢)31.535s (-14.3% 🟢)1.818s31.03x

🔍 Observability: Next.js (Turbopack) | Nitro | Express

workflow with 50 sequential data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)3.867s4.010s0.143s301.00x
🐘 PostgresExpress4.012s (+0.5%)4.493s (+2.8%)0.482s271.04x
💻 LocalNext.js (Turbopack)8.486s9.017s0.531s142.19x
💻 LocalExpress9.064s (-1.6%)9.478s (-5.4% 🟢)0.414s132.34x
💻 LocalNitro9.278s (~)9.942s (-0.8%)0.664s132.40x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro71.447s (-26.3% 🟢)73.075s (-25.8% 🟢)1.628s21.00x
▲ VercelExpress72.056s (-44.6% 🟢)73.881s (-44.1% 🟢)1.825s21.01x
▲ VercelNext.js (Turbopack)74.567s (-30.4% 🟢)76.256s (-30.0% 🟢)1.690s21.04x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 10 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.249s1.007s0.758s601.00x
🐘 PostgresExpress0.289s (+2.3%)1.007s (~)0.718s601.16x
💻 LocalNext.js (Turbopack)0.544s1.004s0.461s602.19x
💻 LocalNitro0.592s (-2.1%)1.022s (~)0.430s592.38x
💻 LocalExpress0.604s (+7.8% 🔺)1.021s (+1.7%)0.417s592.43x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express1.416s (-27.6% 🟢)2.982s (-18.0% 🟢)1.567s211.00x
▲ VercelNitro1.604s (-3.4%)2.969s (-11.4% 🟢)1.365s211.13x
▲ VercelNext.js (Turbopack)1.608s (-20.5% 🟢)3.112s (-18.0% 🟢)1.504s201.14x

🔍 Observability: Express | Nitro | Next.js (Turbopack)

workflow with 25 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.486s1.006s0.520s901.00x
🐘 PostgresExpress0.501s (-1.7%)1.007s (~)0.506s901.03x
💻 LocalExpress2.376s (-5.5% 🟢)3.008s (~)0.632s304.89x
💻 LocalNext.js (Turbopack)2.525s3.009s0.484s305.20x
💻 LocalNitro2.585s (+1.9%)3.009s (~)0.424s305.32x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.851s (-11.6% 🟢)4.168s (-13.5% 🟢)1.317s221.00x
▲ VercelExpress2.858s (-6.2% 🟢)4.555s (-5.2% 🟢)1.697s201.00x
▲ VercelNext.js (Turbopack)3.341s (-5.5% 🟢)4.972s (-4.3%)1.631s191.17x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

workflow with 50 concurrent data payload steps (10KB)

💻 Local Development

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.781s1.007s0.225s1201.00x
🐘 PostgresExpress0.822s (~)1.010s (-0.7%)0.188s1191.05x
💻 LocalExpress10.571s (-5.5% 🟢)11.027s (-7.7% 🟢)0.456s1113.53x
💻 LocalNext.js (Turbopack)10.643s11.207s0.564s1113.63x
💻 LocalNitro11.261s (+0.6%)11.848s (+1.6%)0.587s1114.42x
🐘 PostgresNitro⚠️missing----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)7.395s (-28.4% 🟢)9.144s (-25.6% 🟢)1.748s141.00x
▲ VercelExpress7.507s (+1.2%)9.507s (+2.8%)2.000s131.02x
▲ VercelNitro7.762s (+0.5%)9.268s (-1.4%)1.505s131.05x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

Stream Benchmarks(includes TTFB metrics)
workflow with stream

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
💻 Local🥇 Next.js (Turbopack)0.169s1.003s0.012s1.018s0.848s101.00x
🐘 PostgresExpress0.203s (-1.0%)1.000s (~)0.002s (-6.3% 🟢)1.010s (~)0.807s101.20x
💻 LocalNitro0.204s (-4.6%)1.004s (~)0.011s (-9.6% 🟢)1.018s (~)0.814s101.21x
🐘 PostgresNext.js (Turbopack)0.204s1.001s0.001s1.011s0.806s101.21x
💻 LocalExpress0.227s (+14.2% 🔺)1.004s (~)0.010s (-18.2% 🟢)1.016s (~)0.788s101.34x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Next.js (Turbopack)1.495s (-78.2% 🟢)2.793s (-67.7% 🟢)0.933s (+47.7% 🔺)4.135s (-57.8% 🟢)2.641s101.00x
▲ VercelExpress1.627s (-35.1% 🟢)3.231s (-21.0% 🟢)0.668s (-30.5% 🟢)4.341s (-22.3% 🟢)2.715s101.09x
▲ VercelNitro1.672s (-56.4% 🟢)2.805s (-46.8% 🟢)1.109s (+49.4% 🔺)4.338s (-33.1% 🟢)2.665s101.12x

🔍 Observability: Next.js (Turbopack) | Express | Nitro

stream pipeline with 5 transform steps (1MB)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.609s1.009s0.005s1.022s0.413s591.00x
🐘 PostgresExpress0.632s (~)1.021s (+1.4%)0.004s (+4.4%)1.042s (+1.8%)0.410s581.04x
💻 LocalNext.js (Turbopack)0.756s1.011s0.010s1.117s0.361s541.24x
💻 LocalNitro0.769s (-8.3% 🟢)1.012s (~)0.012s (+25.4% 🔺)1.026s (-8.1% 🟢)0.257s591.26x
💻 LocalExpress0.857s (+13.1% 🔺)1.012s (-1.7%)0.012s (+22.4% 🔺)1.118s (+7.5% 🔺)0.262s541.41x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Express5.777s (-11.2% 🟢)7.473s (-6.7% 🟢)0.185s (-54.8% 🟢)8.112s (-8.2% 🟢)2.335s81.00x
▲ VercelNext.js (Turbopack)6.719s (-60.3% 🟢)8.047s (-55.9% 🟢)0.186s (-11.8% 🟢)8.612s (-54.5% 🟢)1.892s71.16x
▲ VercelNitro8.246s (-72.0% 🟢)9.624s (-68.8% 🟢)0.167s (+48.7% 🔺)10.158s (-68.0% 🟢)1.912s61.43x

🔍 Observability: Express | Next.js (Turbopack) | Nitro

10 parallel streams (1MB each)

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Next.js (Turbopack)0.919s1.072s0.000s1.080s0.161s561.00x
🐘 PostgresExpress0.984s (+2.4%)1.301s (+1.8%)0.000s (~)1.328s (+1.7%)0.344s461.07x
💻 LocalExpress1.238s (+1.0%)2.020s (~)0.000s (+30.0% 🔺)2.022s (~)0.785s301.35x
💻 LocalNext.js (Turbopack)1.241s2.019s0.000s2.022s0.781s301.35x
💻 LocalNitro1.433s (+17.2% 🔺)2.023s (~)0.000s (+292.9% 🔺)2.204s (+9.0% 🔺)0.771s281.56x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro2.869s (-6.0% 🟢)4.073s (-7.3% 🟢)0.000s (-7.1% 🟢)4.417s (-8.2% 🟢)1.548s141.00x
▲ VercelExpress2.934s (-21.6% 🟢)4.316s (-15.4% 🟢)0.000s (-100.0% 🟢)4.733s (-14.4% 🟢)1.799s131.02x
▲ VercelNext.js (Turbopack)3.017s (-70.4% 🟢)4.293s (-62.7% 🟢)0.000s (+Infinity% 🔺)4.672s (-61.2% 🟢)1.655s141.05x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

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

💻 Local Development

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
🐘 Postgres🥇 Express1.793s (+1.2%)2.143s (-1.6%)0.000s (+Infinity% 🔺)2.152s (-2.1%)0.359s281.00x
🐘 PostgresNext.js (Turbopack)1.844s2.145s0.000s2.152s0.308s281.03x
💻 LocalNext.js (Turbopack)3.508s4.033s0.000s4.036s0.528s151.96x
💻 LocalExpress3.603s (+3.9%)4.101s (+1.7%)0.001s (-8.3% 🟢)4.105s (+1.7%)0.502s152.01x
💻 LocalNitro3.674s (+8.5% 🔺)4.164s (+3.3%)0.001s (~)4.167s (+3.2%)0.493s152.05x
🐘 PostgresNitro⚠️missing-----

▲ Production (Vercel)

WorldFrameworkWorkflow TimeTTFBSlurpWall TimeOverheadSamplesvs Fastest
▲ Vercel🥇 Nitro4.063s (-0.8%)5.253s (-2.2%)0.000s (-100.0% 🟢)5.588s (-3.5%)1.526s111.00x
▲ VercelExpress4.167s (-9.2% 🟢)5.682s (-5.6% 🟢)0.000s (NaN%)6.087s (-5.7% 🟢)1.920s111.03x
▲ VercelNext.js (Turbopack)4.455s (-20.7% 🟢)5.836s (-16.4% 🟢)0.000s (-100.0% 🟢)6.230s (-17.4% 🟢)1.774s101.10x

🔍 Observability: Nitro | Express | Next.js (Turbopack)

Summary

Fastest Framework by World

Winner determined by most benchmark wins

World🥇 Fastest FrameworkWins
💻 LocalNext.js (Turbopack)14/21
🐘 PostgresNext.js (Turbopack)12/21
▲ VercelExpress9/21
Fastest World by Framework

Winner determined by most benchmark wins

Framework🥇 Fastest WorldWins
Express🐘 Postgres16/21
Next.js (Turbopack)🐘 Postgres17/21
Nitro💻 Local16/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)

📋 View full workflow run


Some benchmark jobs failed:

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

Check the workflow run for details.

Comment thread.changeset/stream-cancel-propagation-main.md Outdated
Comment threadpackages/world-vercel/src/streamer.ts Outdated
Co-authored-by: Peter Wielander <mittgfu@gmail.com>
Signed-off-by: Peter Wielander <mittgfu@gmail.com>

@TooTallNateTooTallNate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Clean, well-scoped fix. Forward-port of #1801 for main. The approach — cancelled flag as the source of truth plus a single shared AbortController for the whole stream lifetime — is the right pattern for this class of bug.

What looks good

  • Cancellation checks at all the right points: before reader.read(), after reader.read() (covers the case where read completed naturally between abort and flag check), and before reconnect(). Combined with the AbortController plumbed into fetch, this covers all the race windows:

    • Cancel before any pull → initial reader gets cancelled, pull is never invoked
    • Cancel during active read → AbortError swallowed, exits cleanly
    • Cancel during reconnect → in-flight fetch aborted, caught, exits cleanly
    • Cancel between reconnect completion and next read → flag checked at top of loop
  • Shared AbortController across all reconnects is correct. Once aborted, it stays aborted, which means all future connect() calls abort instantly. Right primitive for whole-stream cancellation.

  • Reconnect try/catch properly distinguishes abort-from-cancel (return silently) vs. real errors (propagate via controller.error).

  • reader.cancel().catch() on the closure variable — the comment explicitly acknowledges the TOCTOU window and explains why the cancelled flag is the real guarantee. Good defense-in-depth comment.

  • Changeset correctly scoped to @workflow/world-vercel only.

Test coverage observations

The PR description calls out test 1 (aborts the in-flight upstream fetch via AbortSignal) as failing on main without the fix — I agree, that's the strongest test.

Tests 2 and 3 are more like documentation/regression guards than fix verifications:

  • Test 2 (does not reconnect after the consumer cancels mid-timeout): the test never calls read() after the first one, so pull is never re-invoked — no reconnect path is actually exercised. Pre-fix, fetchCount would also be 1 simply because there's no trigger for a second pull. To really exercise the race, the test would need to let pull enter the reconnect branch before cancel (e.g. drain all data + timeout frame before cancelling). That said, it's still useful as a guard against future regressions where someone might trigger reconnects asynchronously.
  • Test 3 (cancels the active reader when cancel is called during a read): WHATWG streams semantics already make reader.cancel() propagate to the upstream body reader, so this likely passed pre-fix too.

Not blocking — the primary fix is well-verified by test 1.

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

@VaguelySerious@TooTallNate