Avoid no-op backfill state writes - #26420
Merged
Merged
Conversation
zanie-oai
force-pushed
the
zb/avoid-backfill-noop-writes
branch
from
June 4, 2026 16:24
c4f0578 to
a1b5b9e
Compare
zanie-oai
commented
Jun 4, 2026
Co-authored-by: Zanie Blue <zanie@openai.com>
zanie-oai
marked this pull request as ready for review
June 4, 2026 16:46
Contributor
Author
|
In the common case, this causes no change in performance, e.g., there's no cost to do the extra check and the extra check doesn't save us anything, but when there's a writer holding a lock the startup can wait up to 5s for no reason — this eliminates that wait. |
charliemarsh-oai
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
State runtime initialization and backfill-state reads previously executed
INSERT ... ON CONFLICT DO NOTHINGeven in the steady state. SQLite stillenters the writer path for that statement, so TUI and app-server startup could
wait behind another writer for up to the configured five-second busy timeout.
Validation
just test -p codex-state(134 tests passed)just fix -p codex-statejust fmt