Bug 80734 - [WorkbenchLauncher] Unlock Workspace Feature
Summary: [WorkbenchLauncher] Unlock Workspace Feature
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
: 76625 78582 293910 346612 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-10 17:10 EST by Rakesh Malik CLA
Modified: 2019-07-09 10:11 EDT (History)
14 users (show)

See Also:


Attachments
ws_locked_20170427.png screenshot (102.45 KB, image/png)
2017-04-28 04:08 EDT, Martin Oberhuber CLA
no flags Details
Screenshot of workspace locked on MacOSX with Oxygen M7 (43.54 KB, image/png)
2017-05-17 17:58 EDT, Martin Oberhuber CLA
no flags Details
Example dialog allowing to break a lock (52.84 KB, image/png)
2017-05-21 14:14 EDT, Martin Oberhuber CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rakesh Malik CLA 2004-12-10 17:10:57 EST
After my machine went down, I am unable to convince Eclipse to load up my
workspace again. It tells me that it is locked, when clearly it is not.

There needs to be a way to address this.
Comment 1 Kim Horne CLA 2007-09-27 09:24:27 EDT
A solution to this would look like the following:

user selects (or comes up in if there's a default selection) a locked workspace
dialog appears saying it's locked and asks if you'd like to unlock it.  It should warn that if the workspace really is currently in use that it'll do all kinds of horrible things
if the user clicks yes to delete the lock it does so.  otherwise bring up the selection dialog.
Comment 2 Nobody - feel free to take it CLA 2007-09-29 09:10:47 EDT
Hi Kim, i'd like to pick this up for bugday if that's ok?
Comment 3 Kim Horne CLA 2007-10-01 09:05:09 EDT
By all means, please!  Anything with the bugday keyword is fair game.  :)
Comment 4 Nobody - feel free to take it CLA 2007-10-01 09:52:35 EDT
Kim, was looking at this over the weekend and i'm a little confused. 

I have checked the "lock()" and "release()" methods of "Locker_JavaIo.java" and given their implementations cannot see how a user will end up with a locked workspace after an Eclipse crash?

Also, I can't replicate this bug even when i pull the plug on machine at the wall.

Did the "lock()" method originally just check for the presence of the ".lock" file (no deletion check?) and report an error on finding it (assuming Eclipse would have deleted it on normal exit)? This would explain the locked workspace behaviour after a crash.

Or is there a special circumstance under which this situation can, currently, arise?
Comment 5 Kim Horne CLA 2007-10-03 08:21:20 EDT
I would've thought the behaviour you described would cause the problem but it might be that the problem no longer exists.  

Pascal, should this be an issue any longer?
Comment 6 bartosz michalik CLA 2007-10-23 09:29:16 EDT
I belive we can solve it in Students' Eclipse Group of Interest
Comment 7 Nobody - feel free to take it CLA 2007-10-23 09:38:11 EDT
Bartosz, have you verified this is still a problem and if so how did you reproduce it?
Comment 8 bartosz michalik CLA 2007-10-23 14:25:01 EDT
confirmed. this is not a problem for 3.4M2
Comment 9 Boris Bokowski CLA 2009-11-26 16:33:17 EST
Prakash is now responsible for watching bugs in the [WorkbenchLauncher] component area.
Comment 10 Oleg Besedin CLA 2011-06-21 16:25:41 EDT
*** Bug 346612 has been marked as a duplicate of this bug. ***
Comment 11 Martin Oberhuber CLA 2013-11-18 11:49:47 EST
There is a good suggestion how to address this, along with a good comment in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=293910#c1
Comment 12 Paul Webster CLA 2013-11-18 11:49:47 EST
*** Bug 76625 has been marked as a duplicate of this bug. ***
Comment 13 Paul Webster CLA 2013-11-18 11:49:57 EST
*** Bug 78582 has been marked as a duplicate of this bug. ***
Comment 14 Paul Webster CLA 2013-11-18 11:50:39 EST
*** Bug 293910 has been marked as a duplicate of this bug. ***
Comment 15 Martin Oberhuber CLA 2013-11-18 12:02:42 EST
Now that we have 4 duplicates of this, is there a case for increasing priority from its current P5 ? - I liked the suggestion and short discussion in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=293910

Some ideas for improving the situation:

1. Instead of an empty .lock file, write hostname + PID + Eclipse application ID
   into the .lock file.
   That way, when the process crashes hard or the machine reboots (eg out of 
   battery), the .lock file can be safely removed when on the same host and
   the PID doesn't exist any more. It's the typical way how this has been
   dealt with on Linux, and this should capture perhaps 80% of the issues
   without any new UI.

2. In case the hostname is different in the .lock file, improve the error 
   message ("...seems to be locked by "${Eclipse_application_ID} on ${hostname}"
   This helps checking whether a valid instance is still on the workspace or 
   not.

3. In case the hostname is identical AND the PID is still running, improve
   the message ("... seems to be locked by "${Eclipse_application_ID} PID
   ${PID}"  Ideally allow killing PID ${PID} at this point.

4. In case the .lock file does not have the new (hostname, PID, appID) format,
   it might have been created by an older Eclipse. Offer a message like
   {..seems to be locked by an unknown Eclipse session} and allow to delete 
   the .lock file [deletion will likely fail if process is still running].

Thoughts ?
Comment 16 Martin Oberhuber CLA 2013-11-18 13:24:27 EST
CQ:WIND00444398
Comment 17 Paul Webster CLA 2013-11-18 14:05:37 EST
(In reply to Martin Oberhuber from comment #15)
> 
> Thoughts ?

That kind of behaviour certainly seems reasonable.  The PID interaction seems like it would require native fragments.

PW
Comment 18 Martin Oberhuber CLA 2013-11-18 14:40:20 EST
I think that even shooting for a very simple solution could provide good improvement. Just printing "some meaningful data" about the instance that seems to lock the workspace is in the .lock file will already help.

From that point of view, it seems that the
   ManagementFactory.getRuntimeMXBean().getName();
might be good enough for our purpose, but I didn't check whether that also exists on non-Oracle VM's and what it's output format would be. See also
   http://stackoverflow.com/questions/5200269/list-of-running-jvms-on-the-localhost

Note that Java 8 gives access to the PID officially and natively:
   http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4244896
providing full access to the PID as well as killProcess(), so pretty simple code protected by try {...}catch(NoSuchMethodError) should provide tangible improvement without JNI.

So, rather than writing a JNI fragment it might make sense shooting for a simple solution that only works on Java 8 and higher. The goal would be incremental improvement with a simple patch. With a planned GA in March 2014, this would be good timing for a Java 8 based solution.
Comment 19 Martin Oberhuber CLA 2016-04-22 05:25:00 EDT
Lars I wanted to bring this ER to your attention, it looks like a very interesting usability improvement, what do you think ?

Again and again we have users whose machine goes down (eg bluescreen due to power button pressed) while Eclipse is running. Then the workspace is still locked, and it's not intuitive at all how to unlock.

Another use-case is workspace on a shared drive and two different Eclipse (on different host each) try to access the workspace. Then the locking is valid, but the dialog doesn't help much since it won't tell which host still locks the workspace. My 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=80734#c15
proposes a solution ...
CQ:WIND00-WB4-63
Comment 20 Gunnar Wagenknecht CLA 2016-04-22 05:46:50 EDT
Martin, is this really an issue? I do remember having a few crashes on Windows but never experienced the described locking issue. Same on Mac. Never had a lock problem after any crash there and on Windows.

AFAIK the algorithm is relying on file system level locking on Windows already. Thus, after a crash/reboot, no process should have a lock on the ".lock" file and it should be able to start. 

I would check if there are virus scanner, that could cause a lock on the ".lock" file.
Comment 21 Lars Vogel CLA 2016-04-22 07:23:56 EDT
Martin, AFAIK the .lock gets removed automatically if Eclipse crashes on the Equinox level. Adding Tom for details.
Comment 22 Thomas Watson CLA 2016-04-22 09:53:25 EDT
(In reply to Lars Vogel from comment #21)
> Martin, AFAIK the .lock gets removed automatically if Eclipse crashes on the
> Equinox level. Adding Tom for details.

By default the workspace lock is using process locks on a file using java.nio.  I don't see how the presence of a .lock file is causing the workspace to appear locked.  Only if the user is using osgi.locking=java.io would this pose an issue.  Is that the case here?
Comment 23 Martin Oberhuber CLA 2016-04-24 22:43:55 EDT
Ah, turns out our user was using an older Eclipse, and the workspace was on an NFS-mounted home on Linux. I'll check if I can reproduce with Neon. 

Thanks !
Martin
Comment 24 Thomas Watson CLA 2016-04-25 09:09:23 EDT
(In reply to Martin Oberhuber from comment #23)
> Ah, turns out our user was using an older Eclipse, and the workspace was on
> an NFS-mounted home on Linux. I'll check if I can reproduce with Neon. 
> 
> Thanks !
> Martin

I seem to recall way back Java had a hard time implementing nio locks across an NFS-mounted file system.  As a result I think the workaround was to use osgi.locking=java.io

It is possible they are using that setting as a workaround.  I am unsure if things have improved here to allow them to remove that workaround for NFS-mounted directores.
Comment 25 Andrey Loskutov CLA 2016-04-25 09:28:14 EDT
(In reply to Thomas Watson from comment #24)
> (In reply to Martin Oberhuber from comment #23)
> > Ah, turns out our user was using an older Eclipse, and the workspace was on
> > an NFS-mounted home on Linux. I'll check if I can reproduce with Neon. 
> > 
> > Thanks !
> > Martin
> 
> I seem to recall way back Java had a hard time implementing nio locks across
> an NFS-mounted file system.  As a result I think the workaround was to use
> osgi.locking=java.io
> 
> It is possible they are using that setting as a workaround.  I am unsure if
> things have improved here to allow them to remove that workaround for
> NFS-mounted directores.

See bug 44735 and http://bugs.java.com/view_bug.do?bug_id=6628575.
The Eclipse part was fixed long time ago, the Java part should be fixed in Java 7.
Comment 26 Martin Oberhuber CLA 2017-04-28 04:08:53 EDT
Created attachment 268052 [details]
ws_locked_20170427.png screenshot

For the records, I just ran into this again during my work. Eclipse is Mars.2 , the host is CentOS 6.8, the workspace is on NFS: 

[maoberhu@vdi8461 workspace]$ mount | grep eclipseindex 
ahst2100-nas01:/var317/ahs_eclipse_index on /eclipseindex type nfs (rw,addr=121.46.132.17) 


It looks like I had kept my Workbench running (like lots of users do here) when IT decided to reboot the VDI Host machine. I'm working on multiple hosts, so I don't track such reboots. As a result, the workspace/.metadata/.lock file was not removed. When logging in and trying to work again, I see attached (ws_locked_20170427.png) : Not helpful at all ! 

As a user, I need a better hint that helps me recover from the problem, in case my workspace is locked on NFS after a reboot of the host.
Comment 27 Martin Oberhuber CLA 2017-05-17 17:58:09 EDT
Created attachment 268421 [details]
Screenshot of workspace locked on MacOSX with Oxygen M7

Ran into this again, this time on MacOSX 10.11.7 El Capitan running the fresh Oxygen M7 Eclipse SDK -- see attached screenshot.

I don't remember why or how my Mac crashed, probably battery drained to exhaustion over night due to a rogue process. It looks like the Eclipse session that I had running when it crashed wasn't terminated cleanly, leaving the stale lockfile. The lockfile has a date from March 24 (6 weeks ago), i don't use this workspace often.

Proposed fix:
The dialog from the screenshot should have a button for "force unlock now" with a questionmark-hyperlink to learn more about possible causes and consequences.
Comment 28 Martin Oberhuber CLA 2017-05-18 06:19:12 EDT
As a very first step, what about simply changing the message text from:

  "
  The default workspace '/path/to/ws' is in use or cannot be created. Please
  choose a different one.
                                                          [OK]
  "

to

  "
  The default workspace '/path/to/ws' is in use or cannot be created.

  If you think that the workspace is locked incorrectly, you may consider deleting
  the file '<workspace>/.metadata/.lock' end try again. Otherwise, please choose
  a different workspace.
                                                          [OK]
  "
Comment 29 Martin Oberhuber CLA 2017-05-21 14:14:04 EDT
Created attachment 268489 [details]
Example dialog allowing to break a lock

On second thought, I think that exposing internals of the .lock file to end users doesn't look very good.

Perhaps it would be best, to simply allow the user break the lock from the dialog?
I guess 99% of the time, users would know whether they can break the lock, or 
whether an older instance could actually still use the workspace.

See attached for what I see in KeepassX, as an example. We can’t open the workspace
read-only, but allowing to break the lock should be simple. Just replace the “OK” by a 
“Yes/No” dialog, tune the wording, and remove the .lock in the code if Yes is pressed.

Any thoughts anyone?
Comment 30 Andrey Loskutov CLA 2017-05-21 14:43:04 EDT
(In reply to Martin Oberhuber from comment #29)
> Perhaps it would be best, to simply allow the user break the lock from the
> dialog?

I don't think so. 

> I guess 99% of the time, users would know whether they can break the lock,
> or 
> whether an older instance could actually still use the workspace.

In 99% of the time user will shoot himself in the foot, and the rest 1% will reboot Windows als ultimate solution for everything. 

> Any thoughts anyone?

I wonder how you can get into the state at all, where you can't obtain a lock to a file which is not locked anymore by a running Eclipse instance. I think if this is a NFS issue with stale file handles, you should investigate how we can better handle this, means why the lock remains and if this is unavoidable, how we can detetct such cases. One possibility would be to write user, host and pid into the file so the check if the file is locked could check if there is a process of the same user on that host still alive. 

In general, I would not provide the average user the possibility to break the lock. Most of them never read dialogs, and if they read, can't understand our (developers) language anyway, so they will break the lock for still running workspaces all the time and run in even more troubles. This is a box of Pandora, don't open this.
Comment 31 Martin Oberhuber CLA 2017-05-22 06:20:17 EDT
(In reply to Andrey Loskutov from comment #30)
Hi Andrey,

I very much appreciate your comments, and I really feel with you (in fact I had been arguing the same way in the past). But I have some counter arguments:

* This bug has been open since 2004, and in Oxygen - 2017 it's still hurting me.
  Perhaps we've been discussing too complex approaches all the time. IMO, a simple
  solution that covers the 90% case is better than waiting another 13 years for a
  100% solution.

> In 99% of the time user will shoot himself in the foot, and the rest 1% will
> reboot Windows als ultimate solution for everything. 

* I strongly disagree. In this workflow, I'm launching Eclipse and try to open
  my workspace. I see the dialog, now I think "what the heck". I'll not break the
  lock if I have any doubts regarding the workspace still locked. But 90% of
  the time, removing the .lock will be just the right thing.

  I fail to see how I would shoot myself in the foot here ?

> I wonder how you can get into the state at all, where you can't obtain a
> lock to a file which is not locked anymore by a running Eclipse instance. I

* On MacOSX, my computer crashed and on restart the .lock was blocking my workspace.
  No magic around here, local SSD formatted with default HFS+. I am 100% convinced
  that this will happen to other innocent users as well. On Linux, it's proably
  harder to reproduce but having the workspace on NFS while you plug the cable
  and reboot is most likely sufficient.

> think if this is a NFS issue with stale file handles, you should investigate
> how we can better handle this, means why the lock remains and if this is
> unavoidable, how we can detetct such cases. One possibility would be to
> write user, host and pid into the file so the check if the file is locked
> could check if there is a process of the same user on that host still alive.

* Very true, and I have proposed exactly this before, but there are complexities:
  - Deal with older versions of Eclipse which don't write user/host/pid into .lock yet
  - On NFS, if the lock is from a different machine, you still won't be much wiser
    if you can break it or not

Bottom line yes, putting the extra user/host/pid into the file will clearly help but
to me this is just the topping of the cake making the feature more usable. It's not
a must-have. The must-have is _enabling_ the user to break the lock.

As Jeff McAffer always said: Make simple things simple, make hard things possible.
It's really simple allowing the user to break the lock intuitively, and I fail to
see the risk/drawback of enabling this if we craft a reasonable message explaining 
the situation.
Comment 32 Andrey Loskutov CLA 2017-05-22 09:55:28 EDT
(In reply to Martin Oberhuber from comment #31)
> > In 99% of the time user will shoot himself in the foot, and the rest 1% will
> > reboot Windows als ultimate solution for everything. 
> 
> * I strongly disagree. In this workflow, I'm launching Eclipse and try to
> open
>   my workspace. I see the dialog, now I think "what the heck". I'll not
> break the
>   lock if I have any doubts regarding the workspace still locked. But 90% of
>   the time, removing the .lock will be just the right thing.
> 
>   I fail to see how I would shoot myself in the foot here ?

User double clicks on the Eclipse icon and launches Eclipse multiple times on same workspace. He will not realize this and click on handy "remove the lock" button. From here on, he will destroy as much internal workspace data (.metadata) as possible - preferences, indexes, resource database, whatever else programmed with the assumption that there is a workspace lock and they have exclusive access to .metadata files.

> > I wonder how you can get into the state at all, where you can't obtain a
> > lock to a file which is not locked anymore by a running Eclipse instance. I
> 
> * On MacOSX, my computer crashed and on restart the .lock was blocking my
> workspace.
>   No magic around here, local SSD formatted with default HFS+. I am 100%
> convinced
>   that this will happen to other innocent users as well. On Linux, it's
> proably
>   harder to reproduce but having the workspace on NFS while you plug the
> cable
>   and reboot is most likely sufficient.

If we would fail to create a lock, why shouldn't we fail to delete file in this case? I believe this is "exclusive or" case. Either we can lock and have no problem, or we can't lock but also can't delete the faulty file, locked by NFS.

> > think if this is a NFS issue with stale file handles, you should investigate
> > how we can better handle this, means why the lock remains and if this is
> > unavoidable, how we can detetct such cases. One possibility would be to
> > write user, host and pid into the file so the check if the file is locked
> > could check if there is a process of the same user on that host still alive.
> 
> * Very true, and I have proposed exactly this before, but there are
> complexities:
>   - Deal with older versions of Eclipse which don't write user/host/pid into
> .lock yet

I don't think we will have multiple *different* versions of Eclipse trying to access locked files after NFS lock & crash. The probability of this is even lower as the crash holding NFS lock issue alone. I think we shouldn't care about this.

>   - On NFS, if the lock is from a different machine, you still won't be much
> wiser
>     if you can break it or not

At least the user will know that someone else is accessing the same workspace from a different host right now. We have our software tester sharing same account, even if they all sit in a single room, you can't believe how often they were trying to "fix" something in same workspace in parallel, without asking others if there is someone using it.

> Bottom line yes, putting the extra user/host/pid into the file will clearly
> help but
> to me this is just the topping of the cake making the feature more usable.
> It's not
> a must-have. The must-have is _enabling_ the user to break the lock.

*If* we are going to implement something, I would expect that this UI would at least contain some info *who/where* could access the "locked" workspace right now.

> As Jeff McAffer always said: Make simple things simple, make hard things
> possible.

Removing the workspace lock is not simple, it is dangerous.

> It's really simple allowing the user to break the lock intuitively, and I
> fail to see the risk/drawback of enabling this if we craft a reasonable message
> explaining the situation.

As said, most users simply will read the message and do the opposite of what you would expect, means they will most likely destroy they workspaces. Because this is much more severe than just not being able to conveniently remove the lock, I think the impact is way higher.

But again, I question if we can actually "fix" the problem by removing the lock file, because just the presence of the file does not harm. It is the lock on that file which prevents you to start the workspace, and if the lock is really there, we will be not able to remove it *automatically*.

So the only way I see to "fix" the problem is to explain all this to the user, which also means we need explain him not only workspace internal things but also NFS, file locking etc. I doubt this will be useful for an average user at all.
Comment 33 Dani Megert CLA 2017-05-22 10:19:53 EDT
This seems to be a Linux only issue.

On my Windows 7 machine, when I kill java.exe or the shell that started Eclipse, I still have the .lock file but starting the workspace just works fine.
Comment 34 Dani Megert CLA 2017-05-22 10:20:36 EDT
(In reply to Dani Megert from comment #33)
> This seems to be a Linux only issue.

Or at least not a Windows issue.
Comment 35 Dani Megert CLA 2017-05-22 10:24:06 EDT
(In reply to Andrey Loskutov from comment #30)
> (In reply to Martin Oberhuber from comment #29)
> > Perhaps it would be best, to simply allow the user break the lock from the
> > dialog?
> 
> I don't think so. 

I agree! Such a button would be dangerous and as commented before unnecessary on Windows, because there it just works.

So, we should take a closer look why it does not work on Mac and also test on Linux.
Comment 36 Martin Oberhuber CLA 2017-05-22 13:02:34 EDT
Ok, so let's take a step back here.

1. The problem is real. I've experienced it many times - most often on Linux/NFS,
   2 times on MacOSX and also 2-3 times on Windows in the past. For example,
   have your workspace on a USB disk, hibernate Windows while Eclipse is running,
   unplug the USB disk, unhibernate -- I'm quite sure the workspace will be locked
   when you try to open it the next time. Same for workspace on SMB mount when 
   the network cable is plugged.

2. On the other hand, our users are developers. If they act like myself, when they
   see the dialog they'll google "Eclipse workspace cannot be locked" which goes here:
   https://stackoverflow.com/questions/8489322/eclipse-says-workspace-in-use-or-cannot-be-created-chose-a-different-one-ho
   and voila, there is the solution.

So is the issue a blocker? - No, friend Google w/ Stackoverflow come to the rescue.
Is it worth taking any risk? - No, reading stackoverlflow and manually intervening is  likely safer.

But still I think it's a significant usability issue. Especially for rebranded IDEs on top of Eclipse. Some of our customers don't even know they run Eclipse under the hood. They won't go to StackOverflow when they run into this. My scenarios may seem esoteric at first, but I've run into them often enough to know they are real.

I've made many proposals over the years how this could be addressed, and yet it has been deferred again and again. 

Perhaps we should just go back to the improved message text, that explains the .lock file. Yes it does expose internals. But if I experience this situation, I prefer learning about internals than being blocked. I know about 2 customers of ours who wiped their workspaces because they didn't know there was a simple solution. I'm sure we can do better than this at Eclipse.

Cheers,
Martin
Comment 37 Gunnar Wagenknecht CLA 2017-05-22 13:32:27 EDT
(In reply to Martin Oberhuber from comment #36)
> 1. The problem is real. I've experienced it many times - most often on
> Linux/NFS,
>    2 times on MacOSX and also 2-3 times on Windows in the past. For example,
>    have your workspace on a USB disk, hibernate Windows while Eclipse is
> running,
>    unplug the USB disk, unhibernate -- I'm quite sure the workspace will be
> locked
>    when you try to open it the next time. Same for workspace on SMB mount
> when 
>    the network cable is plugged.

Is this even a supported use case, i.e. running with workspace on USB or network drive? This always caused issues in the past (performance issues aside).

FWIW, I never run into this issue on Windows and macOS.
Comment 38 Andrey Loskutov CLA 2017-05-23 04:16:45 EDT
(In reply to Martin Oberhuber from comment #36)
> Perhaps we should just go back to the improved message text, that explains
> the .lock file. Yes it does expose internals. But if I experience this
> situation, I prefer learning about internals than being blocked. I know
> about 2 customers of ours who wiped their workspaces because they didn't
> know there was a simple solution. I'm sure we can do better than this at
> Eclipse.

Yep. I think we should do two things:
1) Write hostname/user/appname into the lock file
2) If we can't lock and have that info above, enhance the message with something like: "Workspace is locked by %app_name% started by user %username% from host %hostname% at %file_access_time%. To unlock this workspace, please make sure %app_name% is terminated. In case this does not help, and you are sure that the workspace is not used anymore by other application, please try to remove the file %workspace_path%/.metadata/.lock and start again."

Patch is welcome: https://wiki.eclipse.org/Platform_UI/How_to_Contribute
Comment 39 Dani Megert CLA 2017-05-24 06:14:54 EDT
(In reply to Andrey Loskutov from comment #38)
> Yep. I think we should do two things:
> 1) Write hostname/user/appname into the lock file
> 2) If we can't lock and have that info above, enhance the message with
> something like: "Workspace is locked by %app_name% started by user
> %username% from host %hostname% at %file_access_time%. To unlock this
> workspace, please make sure %app_name% is terminated. In case this does not
> help, and you are sure that the workspace is not used anymore by other
> application, please try to remove the file %workspace_path%/.metadata/.lock
> and start again."
> 
> Patch is welcome: https://wiki.eclipse.org/Platform_UI/How_to_Contribute

I'm not sure it needs to be that exhaustive. Keep it short, so that the user will actually read the message.

And as mentioned before, I have no issue mentioning the .lock file. If we decide to use another mechanism in the future, we just have to make sure we update the message accordingly. Also, said before: just improving the message a little bit would be acceptable for me for 4.7, but the change should come for RC2.
Comment 40 Eclipse Genie CLA 2019-07-09 03:00:05 EDT
New Gerrit change created: https://git.eclipse.org/r/145666
Comment 41 Jose Probst CLA 2019-07-09 10:11:15 EDT
From the gerrit:

Old Message:
Could not launch the product because the associated workspace at ''{0}'' is currently in use by another Eclipse application.

Latest Proposal:
Could not launch the product because the workspace at ''{0}'' is currently in use by another Eclipse application.\nClose this application to unlock the workspace. If you are sure that it is not used you may delete ''{1}''.\n\nAn erroneously force-unlock will damage the workspace irreversible.

''{1}'' = ''{0}''/.metadata/.lock
What do you think?
Are there any spelling mistakes etc.?