fix(mcp): set SQLite busy_timeout so allowlist CLI works while the service runs #107
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/YT-49-sqlite-busy-timeout"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Makes
yt mcp allowlistreliable whileyt mcp serveis running, and completes its documentation. Implements YT-49.Why
db::openset nobusy_timeout, so ayt mcp allowlist add/removewrite while the service held a lock could fail immediately withdatabase is locked. Both the service and the CLI open the same file viadb::open, and the CLI's whole purpose is to edit the allowlist while the service runs (bootstrap / recovery), so this papercut defeated it.Changes
db::open: add.busy_timeout(Duration::from_secs(5))to the sharedSqliteConnectOptions. A writer now waits up to 5s for the service's brief lock instead of erroring. No on-disk format change (WAL intentionally not enabled; deferred).docs/deployment.mdallowlist section: state the commands are safe to run live, describe thelistoutput (login/email, when, by whom), and documentadd(idempotent) /remove(no-op when absent).Scope note
The request was to bring the
yt mcp allowlistdocs up to date. Rather than document a "stop the service first" workaround, this includes the one-linebusy_timeoutfix so the docs can accurately say the commands are safe to run live.Invariant sweep (every state-DB open gets the busy timeout)
db::openserve,yt mcp allowlist, tests)db::open; no otherSqlitePoolOptions::connectexists in the crateTests
open_sets_busy_timeoutassertsPRAGMA busy_timeoutis 5000 afterdb::open.just pre-commitgreen (89 tests).Related: YT-47 (allowlist CLI), YT-45 (docs rewrite).