SQLite Forum

random DB locks
Login
Iam using a python web-application which utilizes a sqlite-db for storing data.
The Database itselfe is in WAL-mode, and the application always does a commit after a modify-statement keeping lock-times as short as possible, to allow multiple users accessing the web-application.

This were working fine for about a year, but since a few weeks the application crashes randomly with "sqlite3.OperationalError: database is locked".

I'am using the default-timeout from python (5 seconds).

To become a better understanding of the problem i implemented a log-mechanism, writing out some timings/debug-data IF the application require more then 3 seconds to finish successfully. Though that never happens.

Looks like in some rare cases the DB does *not* become unlocked correctly after the application ends successfully, and next time it crashes while waiting for the lock to be released.

I'am wondering if someone else experince that?

All that is running on a Server using RHEL 8.3 and a XFS as FS.