Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] IOException when corrupted index #13456

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

turbolay
Copy link
Collaborator

Some users are reporting this issue, not worth it to investigate, this change in code would work around it.

@lontivero
Copy link
Collaborator

The code tries to delete the database file while a connection is alive and then tries to do things against that connection. So, deleting the file is incorrect.

#r "nuget: Microsoft.Data.Sqlite"

open System.IO
let conn = new SqliteConnection($"Data Source=./test.sql")
conn.Open ()

File.Delete "./test.sql"

use cmd = conn.CreateCommand()
cmd.CommandText <- "CREATE TABLE myTable ( column INTEGER )"
cmd.ExecuteNonQuery()

``

Microsoft.Data.Sqlite.SqliteException (0x80004005): SQLite Error 10: 'disk I/O error'.
at Microsoft.Data.Sqlite.SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db)
at Microsoft.Data.Sqlite.SqliteDataReader.NextResult()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader(CommandBehavior behavior)
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteReader()
at Microsoft.Data.Sqlite.SqliteCommand.ExecuteNonQuery()
at <StartupCode$FSI_0015>.$FSI_0015.main@() in /home/lontivero/stdin:line 15

@turbolay
Copy link
Collaborator Author

Ok. I removed the Delete code

@lontivero lontivero merged commit e9f4dd0 into WalletWasabi:master Sep 24, 2024
3 checks passed
@lontivero lontivero changed the title Work around IOException in SmartResyncIfCorrupted [BugFix] IOException when corrupted index Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants