Skip to content

debug(vtex): probe isolate reuse + per-request timing#428

Closed
viktormarinho wants to merge 1 commit intomainfrom
viktormarinho/vtex-debug-probe
Closed

debug(vtex): probe isolate reuse + per-request timing#428
viktormarinho wants to merge 1 commit intomainfrom
viktormarinho/vtex-debug-probe

Conversation

@viktormarinho
Copy link
Copy Markdown
Contributor

@viktormarinho viktormarinho commented May 6, 2026

Summary

Diagnostic — not for keeps. Wrap `runtime.fetch` in vtex's main.ts with a request counter and isolate-age log so we can see in `wrangler tail` whether Workers is reusing isolates across requests at GRU.

The runtime cache fix (decocms/studio#3300, vtex#427) is deployed but `tools/list` is still 4-7s on every call. Either:

  • The cache wrapper isn't installing (we'd see no `[runtime]` logs from the wrapper)
  • The cache installs but the closure resets per request (Workers spawning fresh isolates → `req#1` repeats)
  • Something else dominates per-request CPU

This probe answers question 2.

Test plan

  • Merge → deploy
  • Hit `tools/list` 5x in a row, check `wrangler tail` for `[vtex-probe]` lines
  • If counter resets to 1 every call → isolate not reused → revisit caching strategy
  • If counter increments → cache should be hitting; runtime needs further investigation

🤖 Generated with Claude Code


Summary by cubic

Adds a temporary debug probe that wraps runtime.fetch in vtex/server/main.ts to log a per-request counter, isolate age, and request timing. This helps confirm Workers isolate reuse and diagnose why tools/list stays slow despite the cache fix.

Written for commit 804a736. Summary will update on new commits.

Wrap runtime.fetch with a request counter and isolate-age log so we
can see in `wrangler tail` whether Workers is reusing isolates across
requests. If `req#1 isolateAge=0` repeats on every call, the runtime
cache can't stick and our perf fix needs a different shape.

To revert after diagnosis.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@viktormarinho
Copy link
Copy Markdown
Contributor Author

abandoning workers migration, reverting to kubernetes-bun

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