Skip to content

Name the module in a prerender stall, and log definition-cache populates - #6185

Merged
backspace merged 3 commits into
mainfrom
name-prerender-stall-module
Sep 21, 2026
Merged

backspace merged 3 commits into
mainfrom
name-prerender-stall-module

Conversation

@backspace

@backspace backspace commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

This is a diagnostic change that helped with the bundling of the base realm.

Claude: Split out of #6087 so it can be reviewed on its own. Observability only, no behavior change.

Two lines that cost me real time to work without while debugging a prerender stall:

A prerender timeout names only the realm. The affinity tag is realm:<url>, so every module of a realm produces the same message and there is no way to tell which one never came back. Adding the subject URL makes the stalled request identifiable.

A definition-cache populate is invisible. A populate happens only when no cached row satisfied the lookup, so a module that populates on every read is a cache that never takes — and nothing said so. One info line per populate makes that legible.

🤖 Generated with Claude Code

A prerender abort reported only the realm it had affinity for, so every
module of a realm read identically and a stall could not be attributed to
one. It now carries the subject URL.

A definition-cache populate is the expensive path a cache hit avoids, and
it happened silently, so a module that populates on every read — a cache
that never takes — was indistinguishable from one that populates once.
Each populate now logs its module and realm.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-17T20:29:28.237172Z 83ea130 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Host Test Results

    1 files  ±0      1 suites  ±0   2h 44m 36s ⏱️ + 6m 54s
4 914 tests ±0  4 900 ✅ ±0  14 💤 ±0  0 ❌ ±0 
4 929 runs  ±0  4 915 ✅ ±0  14 💤 ±0  0 ❌ ±0 

Results for commit 8168614. ± Comparison against earlier commit 3988965.

Realm Server Test Results

    1 files  ±    0    244 suites  ±0   1h 25m 36s ⏱️ - 6m 1s
3 618 tests ±    0  3 618 ✅ +    1  0 💤 ±0  0 ❌  - 1 
3 669 runs   - 3 669  3 669 ✅  - 3 668  0 💤 ±0  0 ❌  - 1 

Results for commit 8168614. ± Comparison against earlier commit 3988965.

@backspace
backspace requested a review from a team September 18, 2026 09:20

@habdelra habdelra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Claude Code 🤖] Reviewed both diagnostics against the paths that produce them — which callers reach the timeout branch and with what attributes, and how often getModuleDefinitionsViaPrerenderer actually runs per lookup. I did not exercise either line at runtime.

No blocking issues. The prerender-timeout half is correct: prerenderModule, prerenderVisit and prerenderScreenshot all pass url, so the stalled subject is named, and runCommand (no url) falls to the empty string rather than url=undefined. The definition-cache line has an accuracy problem worth settling before anyone counts with it.

  1. definition-lookup.ts — the populate line fires once per extension candidate, not once per lookup, so it over-reports populates and can name modules that don't exist; it also opens a second, always-on signal next to the existing once-per-lookup keyLog MISS line that answers the same question with more key detail. See the inline thread.
  2. remote-prerenderer.tsrunCommand timeouts remain unidentifiable; attributes.command would name them the same way. One-line suggestion inline, take or leave.

CI is green.


Generated by Claude Code

Comment thread packages/runtime-common/definition-lookup.ts Outdated
Comment thread packages/realm-server/prerender/remote-prerenderer.ts Outdated
backspace and others added 2 commits September 18, 2026 15:46
The populate line sat inside `getModuleDefinitionsViaPrerenderer`, which
runs once per extension candidate rather than once per lookup, so a
single miss on an extensionless URL emitted several lines and named
modules that need not exist. Counting them would have overstated
populates, which is the one thing the line was for. The file already
warns about exactly this: the MISS line in
`loadDefinitionCacheEntryUncached` excludes per-probe reads because
"those alias probes inflate the count with non-real misses", and it
already answers cache effectiveness once per lookup with more key detail.

So the cache-effectiveness claim goes and the one fact the MISS line does
not carry stays: which candidate was sent. It moves to `definition-cache-key`,
which is off unless `LOG_LEVELS` asks for it, rather than standing as a
second always-on signal on a channel where `info` is the default.

A command request carries no url, so its timeouts kept the anonymity this
branch removes. The command name identifies them; `commandInput`, which
is the part that would carry data, stays out of the message.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@backspace
backspace merged commit f6c1865 into main Sep 21, 2026
65 of 66 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.

2 participants