Skip to content

Handle kv.sqlite database contention/incomplete transactions #2338

@RebeccaMahany

Description

@RebeccaMahany

https://www.sqlite.org/rescode.html#busy

I see three errors in the logs for these:

  • writing settings: upserting into startup_settings: database is locked (5) (SQLITE_BUSY)
  • deleting row from watchdog_logs: database is locked (5) (SQLITE_BUSY)
  • issuing foreach query: database is locked (5) (SQLITE_BUSY) (with iterating sqlite logs)

I think these can also result in errors writing startup settings: writing settings: beginning transaction: SQL logic error: cannot start a transaction within a transaction (1) (I at least have seen those errors co-occur).

We should check to see if we only see the former error from orgs that have the watchdog enabled -- are these three errors related?

I did take a quick look through and did not find an obvious path where the startup settings writer could be called in two places without just reusing the same connection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions