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

Windows leveldb LOCK issues #71

Closed
blahah opened this issue May 9, 2017 · 4 comments
Closed

Windows leveldb LOCK issues #71

blahah opened this issue May 9, 2017 · 4 comments

Comments

@blahah
Copy link
Member

blahah commented May 9, 2017

On Linux and OSX, beta9 seems to work pretty well. On my rather paltry windows testing machine however, the app appears to complete the initial loading and presents a search screen, but never returns any results.

When I open the devtools console (Ctrl Shift I or F12), I get an error from leveldb, that the process cannot get a handle on the LOCK file.

I initially thought that this was a problem with the way leveldb constructs the LOCK file path (i.e. with a / as opposed to an OS-specific path separator, but after trying to manipulate the path inside a running electron instance I don't think that's true.

I'm looking for anyone with a Windows machine (preferably better than my netbook) and some knowledge of levelDB to help debug. If any interested parties could download beta9, run it, and if anything seems off open the console and paste the error here I'd appreciate it.

If anyone can offer any insight into the issue (assuming it is reproducible), that would be even better.

@cboursnell
Copy link

Windows10 Surface Pro 4 the first error in the console is:

events.js:160
err
cause: Error: IO error: LockFile C:\Users\cbour\.sciencefair\collection\docstore/LOCK: The process cannot access the file because it is being used by another process.
message:"IO error: LockFile C:\Users\cbour\.sciencefair\collection\docstore/LOCK: The process cannot access the file because it is being used by another process."
name:"OpenError"
stack:"OpenError: IO error: LockFile C:\Users\cbour\.sciencefair\collection\docstore/LOCK: The process cannot access the file because it is being used by another process.
    at C:\Program Files\ScienceFair\resources\app\node_modules\levelup\lib\levelup.js:119:34
    at C:\Program Files\ScienceFair\resources\app\node_modules\abstract-leveldown\abstract-leveldown.js:39:16"
type:"OpenError"
__proto__:Error

@blahah
Copy link
Member Author

blahah commented May 11, 2017

OK, my best guess here is that for some reason the require cache works differently on Windows than OSX/Linux, which is leading to the local collection leveldb being opened twice.

At the moment we depend on the behaviour that is standard in nodejs where if you require the same file twice in the same process, after the first time you just get an object cached in memory that was loaded at the first require. The only possible way that the local collection could be loaded twice is if this behaviour isn't working on Windows with electron.

I'll try making sure we just load the collection once, and store it in the app state, although I'm rather unhappy about doing that as it makes the state unserialisable, which in turn makes it harder to restore the app state on startup.

@blahah blahah closed this as completed in ef6fda1 May 11, 2017
@blahah
Copy link
Member Author

blahah commented May 13, 2017

@blahah blahah reopened this May 13, 2017
@blahah
Copy link
Member Author

blahah commented May 29, 2017

This is now fixed on all windows instances I have access to. If anyone experiences it again please open a new issue.

Fix should work from v1.0.0beta11 onwards.

@blahah blahah closed this as completed May 29, 2017
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

No branches or pull requests

2 participants