vikunja/pkg/db
kolaente 26c0f71b6c
fix(db): use immediate txlock for SQLite instead of MaxOpenConns(1)
MaxOpenConns(1) caused Go-level deadlocks: when two goroutines needed
database connections concurrently, the second blocked forever waiting
for the single connection pool slot. This broke CI (sqlite web tests
timed out after 45min, e2e tests hung).

The actual "database is locked" errors were caused by SQLite's default
deferred transaction locking: two connections both acquire SHARED locks,
then deadlock when both try to promote to RESERVED for writing. SQLite
detects this instantly and returns SQLITE_BUSY, bypassing busy_timeout.

_txlock=immediate fixes this by acquiring the write lock at BEGIN time.
The second concurrent transaction waits (up to busy_timeout) instead of
deadlocking. Combined with WAL mode (concurrent readers + single writer),
this handles concurrency correctly without restricting the Go connection
pool.
2026-03-02 14:03:33 +01:00
..
fixtures test: add orphaned project fixture for repair-projects command 2026-02-25 11:56:25 +01:00
db.go fix(db): use immediate txlock for SQLite instead of MaxOpenConns(1) 2026-03-02 14:03:33 +01:00
db_path_test.go refactor(db): extract testable ResolveDatabasePath function (#2193) 2026-02-08 10:47:57 +00:00
dump.go fix(db): validate table names and quote identifiers in raw SQL 2026-02-25 13:01:00 +01:00
helpers.go fix: MySQL constraint violations returning HTTP 500 instead of 400 for task bucket duplicates (#1154) 2025-07-22 08:59:12 +00:00
helpers_test.go fix: MySQL constraint violations returning HTTP 500 instead of 400 for task bucket duplicates (#1154) 2025-07-22 08:59:12 +00:00
test.go refactor: remove environment variable requirements for go test 2026-02-17 18:01:05 +01:00
test_fixtures.go refactor: remove environment variable requirements for go test 2026-02-17 18:01:05 +01:00