Repository navigation
Conversation
cbalan
force-pushed
the
claude/kine-cgo-sqlite-wal-checkpoint-659923
branch
from
November 9, 2026 16:30
f24fd2f to
708001d
Compare
cbalan
force-pushed
the
claude/kine-cgo-sqlite-wal-checkpoint-659923
branch
from
November 9, 2026 16:34
708001d to
a29245f
Compare
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.
Cherry-pick of upstream k3s-io/kine@f805442 ("Fix connection leak in Migrate", Tom Wieczorek), with a conventional, non-
forkscope so it passes the master fork policy.Why
Generic.Migrateopened bothCOUNT(*)rows up front and returned after the firstScanfailed. On any database without the legacykey_valuetable, the second row was never read and kept its connection checked out forever. When the SQLite statement cache is on (_stmt_cache_size, part of the default DSN on the release lines), that leaked statement also holds a read transaction on the startup snapshot, so every post-compactionPRAGMA wal_checkpoint(FULL)waits out the full 30 s busy timeout. That is theTestCompactfailure onrelease/vcluster/v0.17.2(ENGCP-1950, blocking #35).Changes
pkg/drivers/generic/generic.go: querykineonly after thekey_valuerow has been scanned and warrants it.pkg/drivers/sqlite/sqlite_test.go(new, cgo only):TestMigrateReleasesItsConnectionsopens the SQLite backend with a 1-connection pool and checks the DB is still usable afterMigrate.Backport adaptations for master: Migrate keeps plain SQL strings (master predates
query.New), and the test uses master's default DSN parameters.Testing
TestMigrateReleasesItsConnectionsfails without the fix (pool exhausted, 5 s timeout) and passes with it.CGO_ENABLED=1 go test ./pkg/drivers/... ./pkg/logstructured/...passes;CGO_ENABLED=0 go build ./...passes.A backport to
release/vcluster/v0.17.2asfix(fork): ...follows in a separate PR.Refs: ENGCP-1950
🤖 Generated with Claude Code