You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
db.busyTimeoutMs: extend config-driven wiring to read-only query paths and Rust connection.rs #1763
Follow-up to #1749 / the grind-phase-7 wiring of DEFAULTS.db.busyTimeoutMs (src/infrastructure/config.ts) into openDb() / openReadonlyOrFail() (src/db/connection.ts).
That change wired the config value as the default parameter of both functions, and threads the actual resolvedconfig.db.busyTimeoutMs value through every call site that already holds a loaded CodegraphConfig with no reordering risk: the build pipeline (pipeline.ts, native-orchestrator.ts, native-db-lifecycle.ts), watch mode (watcher.ts), and openRepo()/openReadonlyWithNative() (via the renamed resolveDbSettings() helper, which already called loadConfig() once for engine resolution).
Two gaps remain, deliberately deferred as out of scope for that change:
~15 ad-hoc read-only query call sites (features/manifesto.ts, features/owners.ts, features/dataflow.ts, domain/search/search/hybrid.ts, domain/analysis/roles.ts, domain/analysis/query-helpers.ts, features/structure-query.ts, domain/search/search/prepare.ts, cli/commands/embed.ts, features/cfg.ts, etc.) call openReadonlyOrFail() directly and get the DEFAULTS.db.busyTimeoutMs default rather than the user's configured override. Several of these already call loadConfig() themselves, but after opening the db, so wiring the value through would require reordering config-load-then-db-open in each file — each reorder needs verification that it doesn't change ConfigError-throw timing/observable behavior for callers that currently see a "no db found" error before any config validation runs.
Rust native DB layer (crates/codegraph-core/src/db/connection.rs:504,522) independently hardcodes PRAGMA busy_timeout = 5000 and doesn't read CodegraphConfig at all. Per the mirrored-engine-layout convention in CLAUDE.md, this should eventually read the same db.busyTimeoutMs value, but that requires the Rust db layer to gain config-loading capability it doesn't currently have — a larger design question than this ticket's scope.
Neither gap causes incorrect behavior today (both fall back to the same hardcoded default that was already in place before the wiring), but full config-driven coverage remains incomplete until these are addressed.
Test coverage exists for both (tests/unit/native-db-busy-timeout.test.ts, tests/unit/native-db-busy-timeout-threading.test.ts, tests/unit/loadconfig-dbpath-resolution.test.ts). Closing as already resolved — no further wiring gap remains.
Activity
carlos-alm commentedon Jul 30, 2026
Both gaps this issue tracked are already closed by prior merged work — verified against current
main:openReadonlyOrFail()call site insrc/now resolvesconfig.db.busyTimeoutMsviaresolveBusyTimeoutMs()(or an already-resolvedbusyTimeoutMsfrom a sharedloadConfig()call) — landed in fix: thread configured busyTimeoutMs through remaining read-only query call sites #1943, with the rootDir-derivation correctness hardened by loadConfig() resolves from process.cwd() instead of the resolved --db path in several read-only query functions #1881 and the busy/locked error handling deduped in refactor: dedupe busy/locked error detection into isBusyOrLockedError #1899.crates/codegraph-core/src/db/connection.rs):open_read_write/open_readonlynow takebusy_timeout_ms: Option<u32>mirroringconfig.db.busyTimeoutMson the TS side, with no remaining hardcodedPRAGMA busy_timeout— landed in fix(native): thread config.db.busyTimeoutMs into NativeDatabase open factories #2021.Test coverage exists for both (
tests/unit/native-db-busy-timeout.test.ts,tests/unit/native-db-busy-timeout-threading.test.ts,tests/unit/loadconfig-dbpath-resolution.test.ts). Closing as already resolved — no further wiring gap remains.fix: apply configured busy_timeout to remaining raw new Database() ca…
fix(ci): add non-blocking reminder for non-closing issue references i…