ribbons / RadioDownloader

An easy to use application for managing podcast subscriptions and downloads.
https://nerdoftheherd.com/tools/radiodld/
GNU General Public License v3.0
15 stars 11 forks source link

Fixed crash on startup if there is not enough space to compact the database #232

Closed ribbons closed 5 years ago

ribbons commented 5 years ago

If a database vacuum is due (three months since the last one) and there is less disk space than the size of the database in either the SQLite temporary directory or the same directory as the database, the application will crash on startup with the following stack trace:

System.Data.SQLite.SQLiteException
   at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
   at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
   at RadioDld.DatabaseInit.Vacuum(Status status) in E:\Development\Radio Downloader\Classes\DatabaseInit.cs:line 311
   at RadioDld.Status.WorkThread() in E:\Development\Radio Downloader\Forms\Status.cs:line 212
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

If the required space is not freed up, the crash will continue to occur each time the application is started.