.lock files left undeleted

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
HomeGoods
Posts: 87

.lock files left undeleted

Sun May 24, 2015 6:20 pm

Hi,
This feature is very useful, particularly at early or trivial development stages.
Option to Lock Local Resources
A new option has been added in Preferences to Lock local resources. When this option is enabled and you open a file from the local file system or a shared network drive, oXygen locks the file for the current user and the file cannot be modified by other users while the lock exists.
But I often find the .lock files not deleted on file close—even after closing the entire oXygen editor. (Standalone, Windows 8.1 x64)
Is it expected in some cases?
Radu
Posts: 6047

Re: .lock files left undeleted

Mon May 25, 2015 9:05 am

Hi,

If lock files created by the current user are left on disk after Oxygen is elegantly closed (not using the Task Manager to kill the application) then that would be a bug in Oxygen.

We'll try to test various scenarios on our side. Have you noticed any particular way to reproduce the issue? At the end of the day are you hibernating the computer with Oxygen started in it?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
HomeGoods
Posts: 87

Re: .lock files left undeleted

Mon May 25, 2015 5:57 pm

I always close oXygen gracefully.
Looks like the problem is reproduced in my production environment, but not repro'ed in my test environment.

On Windows debugger, I watched the behavior of oXygen when test.xhtml is closed (but oXygen itself is not closed). oXygen invokes a series of file APIs in this order:

Reproducing environment:
CreateFile( ".~test.xhtml.lock", OPEN_EXISTING );
CreateFile( ".~test.xhtml.lock", OPEN_EXISTING );
CreateFile( ".~test.xhtml.lock.tmp", CREATE_ALWAYS );
DeleteFile( ".~test.xhtml.lock" );
MoveFile( ".~test.xhtml.lock.tmp", ".~test.xhtml.lock" );
CreateFile( "com.oxygenxml\file.history", CREATE_ALWAYS );

No-repro environment:
CreateFile( ".~test.xhtml.lock", OPEN_EXISTING );
DeleteFile( ".~test.xhtml.lock" );
CreateFile( "com.oxygenxml\file.history", CREATE_ALWAYS );

I don't know how they're mapped to Java API, but hope it helps.
Radu
Posts: 6047

Re: .lock files left undeleted

Tue May 26, 2015 10:15 am

Hi,

This is great, we'll look more on our side.
Three more questions:

1) Are you using multiple started instances of Oxygen?
2) If so, do you sometimes open the same file in both Oxygen instances?
3) If you open the residual lock file with some text editor, does it contain any information inside it? If so, could you paste it in your reply?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
HomeGoods
Posts: 87

Re: .lock files left undeleted

Tue May 26, 2015 3:04 pm

I run a single instance of oXygen.
The .lock files remains on the disk, even if they're on a local disk and shared with nobody.

The information inside a .lock file in chronological order:

Start closing "test.xhtml". At this point, ".~test.xhtml.lock" is:

Code: Select all

[name]~#@[ip]
1432640116297
b24c9a74-2dab-42c1-9b1b-fc2c723cd141
ff1a1502-48c3-4c48-95ce-29d8e0b6c142
d4be5c27-520b-4756-b49e-92d9ec97d509
9b155314-ccce-4c5a-9e02-961550caed5b
oXygen writes the following lines to ".~test.xhtml.lock.tmp":

Code: Select all

[name]~#@[ip]
1432640116297
b24c9a74-2dab-42c1-9b1b-fc2c723cd141
ff1a1502-48c3-4c48-95ce-29d8e0b6c142
d4be5c27-520b-4756-b49e-92d9ec97d509
oXygen deletes "~test.xhtml.lock".
oXygen renames ".~test.xhtml.lock.tmp" to ".~test.xhtml.lock".
Radu
Posts: 6047

Re: .lock files left undeleted

Tue May 26, 2015 4:12 pm

Hi,

Thanks for helping out and sorry if I ask too many questions. Just feel free to answer them when you have the time.
Let's say you close Oxygen, then you remove from the local disk the file .~test.xhtml.lock.
Then you open Oxygen, open the corresponding test.xhtml file, leave it opened for 5-6 minutes, edit it and close it. Does the lock file correctly disappear from disk?

Besides the name and IP info stored in the locking file, those other lines usually remember unique instances of the Oxygen process which have opened the document. Each line is usually remove when the corresponding Oxygen instance is closed but possibly if at a certain time an Oxygen instance was forcefully closed the lock file will forever remain on disk. I will add an issue and try to correct this behavior.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
HomeGoods
Posts: 87

Re: .lock files left undeleted

Tue May 26, 2015 4:40 pm

Tested it. Here's what happend in sequence. The file is on a local disk.

Close oXygen.
Delete .~test.xhtml.lock
Open oXygen.
Open test.xhtml.
".~test.xhtml.lock" is created:

Code: Select all

[name]~#@[ip]
1432646414676
b24c9a74-2dab-42c1-9b1b-fc2c723cd141
ff1a1502-48c3-4c48-95ce-29d8e0b6c142
d4be5c27-520b-4756-b49e-92d9ec97d509
94c0d2ac-9b16-4b5a-af17-ea1aef6c9cd5
f6522132-bd58-4c32-ae67-0a5736659e60
Leave oXygen intact for 10 minutes.
Edit test.xhtml and save it.
".~test.xhtml.lock":

Code: Select all

[name]~#@[ip]
1432647014740
b24c9a74-2dab-42c1-9b1b-fc2c723cd141
ff1a1502-48c3-4c48-95ce-29d8e0b6c142
d4be5c27-520b-4756-b49e-92d9ec97d509
94c0d2ac-9b16-4b5a-af17-ea1aef6c9cd5
f6522132-bd58-4c32-ae67-0a5736659e60
Close test.xhtml.
".~test.xhtml.lock":

Code: Select all

[name]~#@[ip]
1432647014740
b24c9a74-2dab-42c1-9b1b-fc2c723cd141
ff1a1502-48c3-4c48-95ce-29d8e0b6c142
d4be5c27-520b-4756-b49e-92d9ec97d509
94c0d2ac-9b16-4b5a-af17-ea1aef6c9cd5
Close oXygen
".~test.xhtml.lock":

Code: Select all

[name]~#@[ip]
1432647014740
b24c9a74-2dab-42c1-9b1b-fc2c723cd141
ff1a1502-48c3-4c48-95ce-29d8e0b6c142
d4be5c27-520b-4756-b49e-92d9ec97d509
94c0d2ac-9b16-4b5a-af17-ea1aef6c9cd5
HomeGoods
Posts: 87

Re: .lock files left undeleted

Tue May 26, 2015 5:30 pm

Looks like when a locked ditamap is opened in DITA Map Manager, the problem happens with any edit files on that instance of oXygen.

The problem does not happen, when I close the ditamap in DITA Map Manager, close oXygen and then open oXygen (hence no ditamap opened in DITA Map Manager).
But once I try to open the locked ditamap (even if cancelled afterward), the problem starts to happen.
Radu
Posts: 6047

Re: .lock files left undeleted

Wed May 27, 2015 9:21 am

Hi,

Nice catch, we managed to reproduce the issue on our side and hopefully we'll have a fix for it in one of the Oxygen minor bug fix releases. We'll update this thread when we do. Sorry for the inconvenience.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
ionela
Posts: 249

Re: .lock files left undeleted

Mon Jun 08, 2015 11:13 pm

Hello,

Just to update the thread, this problem has been resolved in the latest maintenance build of Oxygen 17.0, 2015052917 (released on June 5th):
Locking local resources: Avoided a few situations that resulted in files remaining locked even after closing, when the "Lock local resources" option is enabled (Preferences, Editor > Open/Save).
You can download it from our web site:
http://www.oxygenxml.com/download.html

The list of bug-fixes can be found here:
http://www.oxygenxml.com/build_history.html#2015052917

You can follow the release/build RSS feed here:
http://www.oxygenxml.com/rssBuildID.xml

Let us know if you encounter further problems with this new build.

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 0 guests