-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
ffldb: close block files #2208
ffldb: close block files #2208
Conversation
f9d7cb3
to
c8611df
Compare
Pull Request Test Coverage Report for Build 9743641160Details
💛 - Coveralls |
This change lets us test that we don't attempt to delete open files with unit tests. On Windows this behavior is not allowed which results in an error but on linux and osx it's allowed. To better test Windows compatibilty adding this explicit check in is useful.
This check let's us ensure that attempting to delete open files are caught during unit tests.
The existing file close code is refactored out into it's own method closeFile() so that it can be reused elsewhere.
The block files may be open when deleteFile is called. This resulted in files not being deleted and erroring out on windows. Properly closing the files closing the files avoids this error.
c8611df
to
c9fae1a
Compare
Pull Request Test Coverage Report for Build 9744922494Details
💛 - Coveralls |
I've had similar issues with Windows, basically that you always need to close files before doing operations such as rename or delete. |
Yeah that seems to have been the issue. No troubles syncing with pruning turned on |
cc: @guggero for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎎
On methods readBlock and readBlockRegion, the opened files were never closed which resulted in errors when attempting to delete these files on pruning on windows. Properly closing the files avoids this error.
Doing a full block sync on windows to make sure. Definitely seems to be the fix as I'm not having any issues so far (few hours into ibd).