fix: harden takumi WASM lock and expand Server-Timing instrumentation#592
Merged
Conversation
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.
commit: |
…i-lock-hardening # Conflicts: # src/runtime/server/og-image/takumi/renderer.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
N/A
❓ Type of 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
withTimeouthelper wraps the Nuxt island fetch, the threenuxt-og-image:*hooks (context,satori:vnodes,takumi:nodes), and the Cloudflare browser launch. Playwright/chrome-launcher/on-demand launchers gain a 15stimeoutoption so a slow browser bring-up rejects instead of blocking indefinitely. Server-Timing also gains entries forresolve-context,island-fetch,vnode-walk,takumi-nodes,lock-wait,satori-init,takumi-init, andtakumi-extract-initso previously-untimed phases show up in the trace.