Repository navigation
Close state-machine gaps in reads, transactions and retries - #78
Merged
Merged
Conversation
- Eager (non-streaming) reads report execution errors instead of an empty result, like the streaming path. - ROLLBACK on a session lost mid-transaction clears the tracked transaction (it was refused forever); ROLLBACK passes the step-entry session check. Connection teardown forgets transaction state so a connection allocated at the same address cannot inherit it. - The per-thread connection-error flag is cleared at the end of every step instead of leaking into the next failing statement. - The description cache leaves its DDL window when the transaction is really idle (autocommit DDL, not inner RELEASE). - A read-ahead stream stepped from another connection keeps its rows instead of being requeried from row 0. - publish-manual-docker moves :latest only for the latest release. Runtime E2E: new eager_query_errors case; reconnect now rolls back and starts a new transaction after a lost session. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex review of the previous commit: - A COMMIT whose session breaks has an unknown outcome; the following ROLLBACK still clears the transaction but reports that instead of claiming success. - The description cache tracks uncommitted DDL per session (the session that executed it) instead of one global flag, so another session's commit or autocommit write cannot end the window and let an old description be cached. - publish-manual-docker runs in the certified publisher's concurrency group and re-reads the latest release right before moving :latest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- publish-manual-docker keeps its own concurrency group: sharing the certified publisher's let a queued manual run replace a pending certified publication. The latest-release recheck before moving :latest stays, and a repository without releases no longer fails. - sqlite3_exec batches mark DDL even when the batch fails: an explicit COMMIT inside the batch can persist DDL before a later statement fails. - Every session reset (pool reset_conn, step read/write PQreset, handle session repair) ends that session's DDL window, so a reset cannot leave the description cache disabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Third review round: the latest-release recheck between writing the version tag and :latest still raced a certified publication, and suppressed API errors turned into a silent partial success that could not be rerun. The decision is now made before any tag is written, errors fail the run, and :latest is left alone while a certified publication is running. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Updated after three rounds of independent review (Codex, ChatGPT subscription):
Clippy is clean, 764 unit tests pass, and runtime E2E (including |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These are targeted fixes for the implicit state machines in the shim that can end up in a wrong state. Each one has its own test where possible.
LIMIT 1) returned an empty result instead of an error, with only a log line (eager_fetch.rs).SQLITE_ERROR, like the streaming path, including retry semantics on a lost session (first_fetch_failure_state, now shared).active. Every statement, including ROLLBACK, was refused until the handle was closed.close_handle_connectionanddestroy_pool_connectionleft the per-address transaction state behind, so a new connection at the same address could inherit it.transaction::forget_connection.STEP_PG_CONN_ERRORcould remain set and make the next failing statement on that thread retry as a connection error.DDL_PENDINGin the description cache was only cleared by transaction control. Autocommit DDL left the cache switched off, and an innerRELEASEended the window too early.should_clear_cross_thread_resultskips streams that have been read ahead (new unit test).publish-manual-docker.ymloverwrote:latestunconditionally, so it could replace a certified image.:latestonly when the tag is the repository's latest GitHub release. This workflow is not in the pinned trust surface.Not changed because the code is already safe:
The pinned release automation (staging concurrency, shadow sidecar) follows in a separate PR because it requires a trust re-bootstrap.
Tests
-D warningsis clean and all 763 unit tests pass.eager_query_errors. Thereconnectcase now also does ROLLBACK, BEGIN, INSERT and COMMIT after a lost session; that failed before this fix. All relevant cases pass locally. The FTS/rtree/REINDEX cases fail identically on main in my local environment because of its SQLite version.🤖 Generated with Claude Code