Repository navigation
feat: SQLite engine self-download resilience - multi-mirror fallback + Node-upgrade hint (#3489) - #3491
Closed
ranxianglei wants to merge 2 commits into
Closed
feat: SQLite engine self-download resilience - multi-mirror fallback + Node-upgrade hint (#3489)#3491ranxianglei wants to merge 2 commits into
ranxianglei wants to merge 2 commits into
Conversation
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4132-pr.3491.c2ea44dThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3491.tgz
npm install -g packageInstall instructions are refreshed on each push. |
The pinned-registry single source made the first-start engine download abort on any slow/blocked network (10s budget at the time; 60s since #3348): one registry down or throttled meant legacy-only until the 6h cooldown expired. When no registry is explicitly configured (BILI_UPDATE_REGISTRY / update.registry), the self-download now walks a built-in public chain - registry.npmjs.org then registry.npmmirror.com - each source under its own timeout budget. An explicitly configured registry stays exclusive: corporate egress must never silently fall through to public mirrors. Per-source failure is logged with its cause and only an all-sources failure arms the existing 6h cooldown marker, whose reason now names every source tried. The sha512 pin applies per source, so a tampered first mirror quarantines itself and the next mirror still serves. Docs: CONFIGURATION.md en/zh updated on both touched rows plus the BILI_UPDATE_REGISTRY env row (its 'leave unset in production' note was stale for the engine-download path). Tests: candidate-resolution matrix, first-mirror-failure fallthrough, all-fail cooldown naming both sources, per-source sha gate.
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.
Closes #3489 (both checklist items).
Context: #3385 / #3338 - two independent Node 20 machines (win32-x64) sat degraded to legacy-only storage because the one-time SQLite engine self-download kept aborting (registry unreachable/throttled from their networks) while the 6h cooldown locked out retries. The timeout budget was already fixed by merged #3348 (10s -> 60s); this PR closes the remaining two gaps owner @ranxianglei raised on #3385.
Item B - Node-upgrade hint in degrade output (commit e1ffda6)
src/storage/driver.tsgainsnodeSqliteUpgradeHint()(empty when this Node has a usable builtin node:sqlite, else a one-line hint). It is appended to exactly two surfaces, and only in that no-builtin case:[storage] unified sidecar failed to open ... staying legacy-onlywarn line (shadow.ts), gated on the engine-unavailable error so corrupt-index warns don't pick it up;degradeReasonwire/diagnostics reason (runtime-status.ts, both no-engine return sites).Behavior change: additive text suffix on those two strings; byte-identical on Nodes that ship builtin node:sqlite. Wire shape unchanged (same fields, longer value). No config/env/deps change.
Item A - multi-mirror fallback for the self-download (commit 0d25c30)
src/storage/engine-bootstrap.ts: when NO registry is explicitly configured (BILI_UPDATE_REGISTRY/update.registry), the download walks a built-in public chain -registry.npmjs.orgthenregistry.npmmirror.com- each source under its own timeout budget. An explicitly configured registry stays exclusive: corporate egress must never silently fall through to public mirrors. Per-source failures are logged with their cause; only an all-sources failure arms the existing 6h cooldown marker, whosereasonnow names every source tried (marker shape{atMs, reason}unchanged). The sha512 pin applies per source, so a tampered first mirror quarantines itself and the next mirror still serves.Behavior change:
Docs: CONFIGURATION.md en/zh updated on both touched rows plus the
BILI_UPDATE_REGISTRYenv row - its "leave unset in production" note was stale for the engine-download path, where setting a reachable mirror is now the documented workaround when the default registry is blocked.Tests
Targeted locally (green):
tests/storage-engine-bootstrap.test.ts29/29 - new: candidate-resolution matrix (unset / explicit primary / explicit secondary / corporate exclusive), first-mirror-failure fallthrough, all-fail cooldown naming both sources + retry suppression, per-source sha gate;tests/web-storage-banner.test.ts6/6 - new hint test, probe-overridden so it holds on any Node version. Full-suite verdict = the CI lanes on this head.