Skip to content

Stop refusing a link store a loaded machine would have opened - #28

Merged
jimhoyd merged 1 commit into
mainfrom
claude/tender-gates-13ovkk
Sep 17, 2026
Merged

jimhoyd merged 1 commit into
mainfrom
claude/tender-gates-13ovkk

Conversation

@jimhoyd

@jimhoyd jimhoyd commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

Problem and change

verify run 138 on main failed one leg of 11 — verify (windows-latest, 26):

test at test\links.test.js:379:1
✖ link observers are opt-in, bounded and cannot delay, break or outlive a redirect
  Error: Link store initialization failed
      at Timeout.<anonymous> (src/link-store.js:40:43)

The Timeout frame identifies it exactly: the link-store worker did not report ready inside the fixed 5s startup deadline. Not a crash — the worker simply had not finished booting.

That deadline is a backstop against a worker that will never answer, not a performance budget. The failures it exists to catch — an unpatched SQLite build, an unreadable or non-regular file — report themselves in milliseconds through an explicit {failed:true} message, not by timing out. Meanwhile a cold, contended machine (here: nine matrix legs on one runner) can legitimately take seconds to boot a worker thread and open SQLite, and 5s sits inside that variance. Refusing to start a store the machine would have opened is the worse failure, so the backstop moves to 15s — still fast enough to fail a genuine hang in front of a human.

This is a product robustness fix, not a test fix: the same 5s applies to urlcode serve --link-store … on any busy or cold host.

Second change, from what this cost to diagnose: the three ways a start can fail — the timeout, an explicit worker failure, and an exit or error during start — all raised the identical sentence. Telling them apart needed a stack trace. Each now names its cause:

  • …failed: no ready signal within 15000ms
  • …failed: the worker could not open the store
  • …failed: the worker exited or errored during start

All three keep the initialization failed prefix, so the existing assertion at test/links.test.js:150 still matches.

Note this test is not Windows-specific — Windows runners are simply the only CI legs whose Node ships a patched SQLite, so liveLinksSkip skips these tests everywhere else. The exposure is on every host that actually supports live links.

Verification

npm run verify   # 167 tests, 0 fail, 29 skipped

Not verified here, and worth being plain about: this container's SQLite is 3.51.2, which is not one of the patched builds live links require (3.51.3+, 3.50.7, 3.44.6). Every live-link test skips locally, so the changed path cannot execute in this environment. I confirmed the full suite passes with no regression and that the changed error strings still satisfy the existing assertion, but CI on a supported build is the real check.

I did not attempt to reproduce the timeout — it depends on runner load I cannot recreate — so this is reasoning from the stack frame rather than a reproduction. A re-run of the failed leg would likely have passed, which is exactly why the deadline, not the run, is what needed changing.

Compatibility and security

  • No API, YAML or CLI surface changes. One internal constant and three error strings.

  • A hang is still bounded; the bound is 15s instead of 5s. Nothing becomes unbounded.

  • The per-operation 5s timeout in call() is deliberately untouched — a query that takes 5s is a real fault, unlike a one-time worker boot.

  • Changes match the documented portable contract; docs/examples are updated where needed.

  • Relevant tests and package checks pass, or limitations are explained above.

  • No credentials, customer data or private project material are included.

  • Runtime/starter changes remain aligned where applicable.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WrwFcAcntyBBSk21irvgAV


Generated by Claude Code

verify run 138 on main failed one Windows leg: the link-store worker did
not report ready within the fixed 5s startup deadline, so a test that
only ever runs where live links are supported failed with "Link store
initialization failed".

The deadline is a backstop against a worker that will never answer, not
a performance budget. The failures it exists to catch — an unpatched
SQLite build, an unreadable file — report themselves in milliseconds
through an explicit failure message. A cold, heavily loaded machine can
legitimately take seconds to boot a worker thread and open SQLite, and
5s sits inside that variance. Refusing to start a store the machine
would have opened is the worse failure, so the backstop moves to 15s.

The three ways a start can fail were also indistinguishable: a timeout,
an explicit worker failure and an exit during start all raised the same
sentence, which is why the run needed a stack trace to tell apart. Each
now names its cause.

Not verified here: this container's SQLite is 3.51.2, so every live-link
test skips locally and the changed path cannot run. The full suite
passes with no regression; CI on a supported build is the check.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WrwFcAcntyBBSk21irvgAV
@jimhoyd
jimhoyd merged commit c5cb255 into main Sep 17, 2026
24 checks passed
@jimhoyd
jimhoyd deleted the claude/tender-gates-13ovkk branch September 17, 2026 11:52
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