Skip to content

fix: harden takumi WASM lock and expand Server-Timing instrumentation#592

Merged
harlan-zw merged 5 commits into
mainfrom
feat/timing-and-takumi-lock-hardening
May 1, 2026
Merged

fix: harden takumi WASM lock and expand Server-Timing instrumentation#592
harlan-zw merged 5 commits into
mainfrom
feat/timing-and-takumi-lock-hardening

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

N/A

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Hangs in the takumi WASM render path (or any user hook) used to pile up behind the shared lock and pin requests until the outer renderTimeout fired. The lock now has split acquire/render timeouts: a hung render rejects with 408 and the renderer is recreated instead of poisoning the chain, while subsequent waiters bail early instead of burning CPU behind a stuck holder.

A new withTimeout helper wraps the Nuxt island fetch, the three nuxt-og-image:* hooks (context, satori:vnodes, takumi:nodes), and the Cloudflare browser launch. Playwright/chrome-launcher/on-demand launchers gain a 15s timeout option so a slow browser bring-up rejects instead of blocking indefinitely. Server-Timing also gains entries for resolve-context, island-fetch, vnode-walk, takumi-nodes, lock-wait, satori-init, takumi-init, and takumi-extract-init so previously-untimed phases show up in the trace.

Split the takumi WASM lock into separate acquire/render timeouts so a hung
render rejects with 408 and recreates the renderer instead of poisoning the
lock chain. Waiters bail early instead of piling CPU behind a stuck holder.

Adds a withTimeout helper and applies it to fetchIsland, the three
nuxt-og-image hooks (context, satori:vnodes, takumi:nodes), and Cloudflare
browser launch. Playwright launchers gain a 15s timeout option.

New Server-Timing entries: resolve-context, island-fetch, vnode-walk,
takumi-nodes, lock-wait, satori-init, takumi-init, takumi-extract-init.
@pkg-pr-new

pkg-pr-new Bot commented May 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nuxt-og-image@592

commit: b0fd2c0

@harlan-zw harlan-zw changed the title feat: harden takumi WASM lock and expand Server-Timing instrumentation fix: harden takumi WASM lock and expand Server-Timing instrumentation May 1, 2026
@harlan-zw harlan-zw merged commit 94fb65d into main May 1, 2026
10 checks passed
Sign up for free to 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.

1 participant