mirror of
https://github.com/openai/codex.git
synced 2026-10-31 19:28:49 +00:00
Route SQLite logs to an explicitly configured log_dir (#55978)
## What changed - Store `logs_2.sqlite` in `log_dir` when explicitly configured, unless a managed `sqlite_home` requirement applies. Keep other databases in `sqlite_home` and preserve the existing SQLite log location when `log_dir` is unset. - Initialize and lock the selected log directory only when opening its database, so an unavailable directory does not prevent authentication commands from loading configuration. Share the cleanup lock across configuration clones and allow failed initialization to be retried. - Leave existing logs in place. Read legacy logs for diagnostic submissions when the current query returns no logs, attaching them as `codex-logs-legacy.log`. Continue retention cleanup and page reclamation for both locations, with independent maintenance locks and filesystem checks. ## Testing Add coverage for configuration routing and managed requirements, deferred initialization and lock lifetimes, authentication with an unavailable log directory, legacy log attachments, and cleanup of current and legacy databases. GitOrigin-RevId: 48216694596d738eff1b3c5eef6c4e7ada6d0137
This commit is contained in:
committed by
copyberry
parent
3c4c04b224
commit
17a0e6f63f
@@ -54,7 +54,7 @@ async fn runtime_opens_recover_or_report_corruption_by_database_policy() -> anyh
|
||||
let home = root.join(spec.label);
|
||||
tokio::fs::create_dir_all(&home).await?;
|
||||
let sqlite = SqliteConfig::new_for_testing(home.as_path().abs());
|
||||
let path = spec.path(&home);
|
||||
let path = spec.path(&sqlite);
|
||||
let fixture = path.with_extension("fixture");
|
||||
let pool = sqlx::SqlitePool::connect_with(
|
||||
sqlx::sqlite::SqliteConnectOptions::new()
|
||||
|
||||
Reference in New Issue
Block a user