Skip to content

Avoid SQLite stalls from connection setup and stderr span logging - #49032

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/40d4ef32c7efc49f4240b987277ba45551259335
Sep 28, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/40d4ef32c7efc49f4240b987277ba45551259335

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Avoid SQLite stalls from connection setup and stderr span logging

Why

Setting auto_vacuum on every connection can wait for a writer lock even when the mode is unchanged. Logging every span entry and exit can also block SQLx workers on undrained stderr while they hold a write transaction.

What changed

  • Set incremental vacuum only for empty databases or databases using full auto-vacuum, before enabling WAL. Preserve existing nonempty databases with auto-vacuum disabled.
  • Emit span creation and closure events in app-server text and JSON stderr logs, preserving busy/idle timings and explicit events while omitting span entry and exit records.

Testing

Add regression tests for opening and expanding writable pools while another connection holds a writer lock, and for transaction completion with undrained stderr in both log formats. Verify vacuum modes and retained log diagnostics.

…9032)

## Why

Setting `auto_vacuum` on every connection can wait for a writer lock even when the mode is unchanged. Logging every span entry and exit can also block SQLx workers on undrained stderr while they hold a write transaction.

## What changed

- Set incremental vacuum only for empty databases or databases using full auto-vacuum, before enabling WAL. Preserve existing nonempty databases with auto-vacuum disabled.
- Emit span creation and closure events in app-server text and JSON stderr logs, preserving busy/idle timings and explicit events while omitting span entry and exit records.

## Testing

Add regression tests for opening and expanding writable pools while another connection holds a writer lock, and for transaction completion with undrained stderr in both log formats. Verify vacuum modes and retained log diagnostics.

GitOrigin-RevId: 40d4ef32c7efc49f4240b987277ba45551259335
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/40d4ef32c7efc49f4240b987277ba45551259335 branch from 01d20a8 to 46fdd5e Compare September 28, 2026 17:00
@copyberry
copyberry Bot merged commit 46fdd5e into main Sep 28, 2026
18 of 25 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/40d4ef32c7efc49f4240b987277ba45551259335 branch September 28, 2026 17:01
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 28, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants