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

Got FileSystemException when repairing database #23

Open
tworogue opened this issue Feb 11, 2019 · 2 comments · May be fixed by #60
Open

Got FileSystemException when repairing database #23

tworogue opened this issue Feb 11, 2019 · 2 comments · May be fixed by #60
Labels
bug Something isn't working

Comments

@tworogue
Copy link

Every time when repairing database after incorrect shutdown I get following error:

Caused by: java.nio.file.FileSystemException: C:\database\1549869944.index.repair -> C:\database\1549869944.index: The process cannot access the file because it is being used by another process.

It seems like when calling method openDataFilesForReading() my '.index' file has been opened for reading and hadn't been closed after it. No other processes use this file.

So when we call method repairFile(DBDirectory dbDirectory) we get an exception in line: Files.move(repairFile.indexFile.getPath(), indexFile.getPath(), REPLACE_EXISTING, ATOMIC_MOVE);

Any suggestions on how to avoid this error?

@bellofreedom bellofreedom added the bug Something isn't working label Dec 26, 2019
@wangtao724
Copy link
Contributor

Are you still experiencing the issue on latest version?

@RisbergAdam
Copy link

RisbergAdam commented Aug 19, 2021

I am still experiencing this issue. The exception is thrown from this line in HaloDBFile. Both me and @tworogue are on Windows, that might be why? The documentation for Files.move states this for the ATOMIC_MOVE flag:

The move is performed as an atomic file system operation and all other options are ignored. If the target file exists then it is implementation specific if the existing file is replaced or this method fails by throwing an IOException.

Edit: I removed the ATMIC_MOVE flag but that did not solve anything.

@RisbergAdam RisbergAdam linked a pull request Aug 19, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants