Bound SQLite integrity checks for diagnostic attachments (#40688)

## Why

Diagnostic uploads skip the doctor attachment if report generation exceeds its
overall timeout. SQLite integrity scans can be delayed by large databases or
lock contention.

## What changed

- Give each database integrity scan a one-second deadline when collecting a
  diagnostic attachment.
- Interrupt scans and lock waits at the deadline, preserve any corruption rows
  already returned, and report an incomplete clean scan as a warning.
- Keep direct `codex doctor` integrity checks unbounded.

## Testing

- Cover interrupted scans, lock waits, retries without a deadline, and
  corruption results returned before interruption.

GitOrigin-RevId: 4817fb459ac53953669a9ba5f03397a6fc82c72e
This commit is contained in:
chess authored and copyberry committed 2026-08-25 20:09:55 +00:00
1 parent 94967e03e5
commit 32ce703a80
7 files changed
+194 -53

No files matched your search

+1 -1
View File
@@ -843,7 +843,7 @@ async fn repair_recency_migration_succeeds_while_another_connection_holds_writer
.await
.expect("current migrations should apply");
let read_pool = sqlite
.open_read_only_pool(&state_path)
.open_read_only_pool(&state_path, /*busy_timeout*/ None)
.await
.expect("read-only pool should open");
let mut write_connection = pool.acquire().await.expect("write connection should open");