Closed natsukagami closed 4 years ago
What version are you encountering the bug in? v0.6.0 but basically all versions
Describe the bug go-sqlite doesn't play well with concurrent writes in the default configuration. This shows up as database is locked errors.
database is locked
Relevant context https://github.com/mattn/go-sqlite3/issues/274
To Reproduce Perform mass rejudge and some write requests at the same time.
Logs kjudge.db.zip by @TrungNguyen1909
Additional context
3 steps to mitigate this (from above context):
?cache=shared
_journal=WAL
_busy_timeout
db.SetMaxOpenConns(1)
What version are you encountering the bug in? v0.6.0 but basically all versions
Describe the bug go-sqlite doesn't play well with concurrent writes in the default configuration. This shows up as
database is locked
errors.Relevant context https://github.com/mattn/go-sqlite3/issues/274
To Reproduce Perform mass rejudge and some write requests at the same time.
Logs kjudge.db.zip by @TrungNguyen1909
Additional context
3 steps to mitigate this (from above context):
?cache=shared
) and WAL journaling mode (_journal=WAL
) to minimize write-locks_busy_timeout
to a crazy high value) - makes kjudge slower? (needs benchmark), or...db.SetMaxOpenConns(1)
). Yuck?