Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 509142

Summary: EEXIST errors in console for the prefs.json.lock file
Product: [ECD] Orion Reporter: Remy Suen <remy.suen>
Component: ElectronAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: Michael_Rennie, Silenio_Quarti
Version: 13.0   
Target Milestone: 15.0   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Remy Suen CLA 2016-12-13 05:56:35 EST
1. Open Electron from the command line.
2. Open the 'Git' view.
3. See EEXIST errors in the console.

These errors are caused by the savePrefs(*) function in lib/controllers/prefs.js.

Error: EEXIST: file already exists, open 'C:\Users\Remy\.orion\prefs.json.lock'
    at Error (native)
Error: EEXIST: file already exists, open 'C:\Users\Remy\.orion\prefs.json.lock'
    at Error (native)
Error: EEXIST: file already exists, open 'C:\Users\Remy\.orion\prefs.json.lock'
    at Error (native)
Error: EEXIST: file already exists, open 'C:\Users\Remy\.orion\prefs.json.lock'
    at Error (native)
Comment 1 Michael Rennie CLA 2017-01-18 15:29:55 EST
I just ran into this while reviewing https://git.eclipse.org/r/#/c/81197/.

It was happening because something that tried reading a pref file threw an exception after opening the file, causing fs to not release the lock.
Comment 2 Silenio Quarti CLA 2017-03-23 17:01:38 EDT
Fixed a adding an option to consider the lock is stale after 5s of use. Writing pref files should not take longer than 5 seconds.

https://git.eclipse.org/c/gerrit/orion/org.eclipse.orion.client.git/commit/?id=2a32e45d1835f3a2e540b3c4cfffa89f4ba5755a
Comment 3 Remy Suen CLA 2017-04-02 20:44:07 EDT
Just got hit by this again.
Comment 4 Remy Suen CLA 2017-04-02 20:44:45 EDT
(In reply to Remy Suen from comment #3)
> Just got hit by this again.

I only saw one instance of the error message though. And I'm running on Node instead of Electron (unlike what I originally reported in comment 0).