Skip to content
go-libfossil Tags and Properties
Login

Tags and Properties

Tags and Properties for Check-in 202576c58c

Context
2026-05-13
19:22 • Edit [202576c58c]: Add tag "db/driver/ncruces/v0.2.0" with note "ncruces/v0.2.0 — _txlock=immediate fix (libfossil#33)". artifact: 71a4c16701 user: [email protected]
19:22 • Edit [202576c58c]: Add tag "db/driver/modernc/v0.2.0" with note "modernc/v0.2.0 — _txlock=immediate fix (libfossil#33)". artifact: 270c51d705 user: [email protected]
19:10 • Edit [202576c58c]: Add tag "v0.6.3" with note "v0.6.3 — fix concurrent-writer SQLITE_BUSY race

Fixes #33: db.WithTx opens BEGIN DEFERRED, so under WAL two concurrent writers race the SHARED→RESERVED upgrade and SQLite's deadlock-avoidance returns SQLITE_BUSY immediately — bypassing busy_timeout entirely.

DSN now sets _txlock=immediate in both modernc and ncruces drivers so every BEGIN acquires RESERVED upfront. The second concurrent writer blocks at BEGIN (where busy_timeout applies) instead of racing at the upgrade.

Verified empirically: 50/50 fail without fix, 0/50 with fix.". artifact: 25d003d6d8 user: [email protected]

19:09
fix: DSN _txlock=immediate to serialize writers at BEGIN (#33) (#34)

Two concurrent libfossil.Repo handles on the same SQLite file fail their writes with SQLITE_BUSY immediately, well under the configured busy_timeout=5000 window. Reproduces ~50% of the time on contended manifest.Checkin paths.

Root cause: db.WithTx opens BEGIN DEFERRED. Under WAL, a deferred transaction acquires SHARED on first read, then upgrades SHARED→RESERVED on first write. If two connections race that upgrade, SQLite's deadlock-avoidance returns SQLITE_BUSY *immediately*, bypassing busy_timeout entirely (documented behavior, sqlite.org/c3ref/busy_timeout.html).

Fix: prepend _txlock=immediate to the DSN in both modernc and ncruces drivers. Every BEGIN now acquires RESERVED upfront, so the second writer blocks at BEGIN — where busy_timeout *does* apply — and the two transactions serialize cleanly.

Regression tests added to both driver packages: - TestBuildDSN_TxlockImmediate covers the DSN shape across empty/non-empty pragma maps. - TestConcurrentWritersDoNotRace reproduces the issue-#33 contention pattern (two conns, SELECT then INSERT under DEFERRED) over 25 iterations and asserts zero SQLITE_BUSY. Without the fix, this test fails 25/25; with the fix, 0/25.

Closes #33. check-in: 202576c58c user: [email protected] tags: trunk, v0.6.3, db/driver/ncruces/v0.2.0, db/driver/modernc/v0.2.0

2026-04-19
16:30
Initial open source release

libfossil is a pure-Go implementation of the Fossil SCM, reading and writing the same .fossil SQLite repository format as upstream Fossil.

This is the first public release of code that previously lived in a private repository. The module path is github.com/danmestas/libfossil and the binary is named libfossil to avoid $PATH collisions with upstream fossil.

Included: - Repo lifecycle (create, clone), checkout/checkin, timeline, merge, diff, annotate, shun, tag, branch, bisect, stash, undo/redo - Sync-over-HTTP protocol (client and handler) - Two SQLite drivers: modernc (pure Go, default) and ncruces (wasm-capable) - Observer interfaces (SyncObserver, CheckoutObserver) with an optional OpenTelemetry implementation in observer/otel (separate submodule) - Deterministic simulation testing harness with BUGGIFY fault injection - Kong-based embeddable CLI under cli/ and a standalone binary under cmd/libfossil/ check-in: f5744359d3 user: [email protected] tags: trunk