Open gyorb opened 6 years ago
How can a database be locked?
@bruntib
How can a database be locked?
The user specified in the connection string does not have write access, or a schema transaction (such as an ongoing migration?) or the database server (e.g. for a journaling recovery or after sensing a corrupted physical layer (data storage files)) put an exclusive system lock on the database itself.
It SHOULD be rare in normal circumstances, but not something that can't happen at all.
I don't know the exact details on how it can happen with Postgres. MySQL was really trigger happy on locking you out of your own database if the backing files were corrupted (sometimes due to some COW or RAID falling out of sync).
The most simple answer could be the backing files (or file for SQLite) having the write permission removed?
Give the user some warning if deleting a run is not possible because it is locked.