mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
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:
@@ -291,12 +291,19 @@ impl SqliteConfig {
|
||||
}
|
||||
|
||||
/// Open an existing Codex SQLite database without creating or modifying it.
|
||||
pub async fn open_read_only_pool(&self, path: &Path) -> Result<SqlitePool, Error> {
|
||||
let options = SqliteConnectOptions::new()
|
||||
pub async fn open_read_only_pool(
|
||||
&self,
|
||||
path: &Path,
|
||||
busy_timeout: Option<Duration>,
|
||||
) -> Result<SqlitePool, Error> {
|
||||
let mut options = SqliteConnectOptions::new()
|
||||
.filename(path)
|
||||
.create_if_missing(false)
|
||||
.read_only(true)
|
||||
.log_statements(LevelFilter::Off);
|
||||
if let Some(busy_timeout) = busy_timeout {
|
||||
options = options.busy_timeout(busy_timeout);
|
||||
}
|
||||
SqlitePoolOptions::new()
|
||||
.max_connections(1)
|
||||
.connect_with(options)
|
||||
|
||||
Reference in New Issue
Block a user