-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add watchdog for sqlite deadlock on db init:
some cifs servers cause sqlite to fail in interesting ways; any attempt to create a table can instantly throw an exception, which results in a zerobyte database being created. During the next startup, the db would be determined to be corrupted, and up2k would invoke _backup_db before deleting and recreating it -- except that sqlite's connection.backup() will hang indefinitely and deadlock up2k add a watchdog which fires if it takes longer than 1 minute to open the database, printing a big warning that the filesystem probably does not support locking or is otherwise sqlite-incompatible, then writing a stacktrace of all threads to a textfile in the config directory (in case this deadlock is due to something completely different), before finally crashing spectacularly additionally, delete the database if the creation fails, which should prevents the deadlock on the next startup, so combine that with a message hinting at the filesystem incompatibility the 1-minute limit may sound excessively gracious, but considering what some of the copyparty instances out there is running on, really isn't this was reported when connecting to a cifs server running alpine thx to abex on discord for the detailed bug report!
- Loading branch information
Showing
1 changed file
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters