Skip to content

Fix log db batch flush flake#19959

Merged
dylan-hurd-oai merged 1 commit intomainfrom
codex/fix-log-db-batch-flake
Apr 28, 2026
Merged

Fix log db batch flush flake#19959
dylan-hurd-oai merged 1 commit intomainfrom
codex/fix-log-db-batch-flake

Conversation

@dylan-hurd-oai
Copy link
Copy Markdown
Collaborator

@dylan-hurd-oai dylan-hurd-oai commented Apr 28, 2026

Why

The log DB writer batches tracing events before inserting them into SQLite, but tokio::time::interval produces an immediate first tick. That meant the inserter could flush the first accepted log entry before batch_size was reached, making configured_batch_size_flushes_without_explicit_flush timing-sensitive in CI.

What Changed

  • Consume the interval's startup tick before entering the inserter loop, so interval flushing starts after the configured delay.
  • Remove the test's startup sleep, which was masking the race instead of proving the batch-size behavior.

Validation

  • cargo test -p codex-state
  • cargo test -p codex-state configured_batch_size_flushes_without_explicit_flush passed 3 consecutive focused runs
  • PR checks passed across rust-ci, Bazel, ci, sdk, cargo-deny, Codespell, blob-size policy, and CLA

@dylan-hurd-oai dylan-hurd-oai added the codex Label used by connector to tag PRs that have been reviewed by Codex label Apr 28, 2026
@dylan-hurd-oai dylan-hurd-oai marked this pull request as ready for review April 28, 2026 17:14
@dylan-hurd-oai dylan-hurd-oai merged commit 7f7c7c2 into main Apr 28, 2026
25 checks passed
@dylan-hurd-oai dylan-hurd-oai deleted the codex/fix-log-db-batch-flake branch April 28, 2026 19:08
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

codex Label used by connector to tag PRs that have been reviewed by Codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants