Improve workspace lock dialog.
If the workspace directory which we are trying to use is locked then we get the below dialog.
This dialog is good. But we can improve this dialog with some other information like
-
user.name: This greatly help the user in case of multi user environment where multiple developers uses common workspace which is located on the network. -
host-name: This gives little more hint that from host that lock has been initiated. -
DISPLAYon Linux - gives a hint which VNC session is locking workspace - JVM process id, so one could see which from many Eclipse processes on same host/user is holding the lock.
This will make user life easy if they know who has held the workspace and they can talk to the respective developer.
Plan:
We can write the above mentioned information onto .metadata/.lock file file. When any user successfully acquires the lock.
If the next user failed to get the lock, Then we can read this file and show this data (if available on current OS) inside error dialog above shown.
When you working on this anyway .. add the PID (ProcessID )that holds the lock
... and DISPLAY value on Linux, as we have VNC sessions of same user running on same host but with different X11 DISPLAY's.
I've updated TODO's list.
Note, some of the information (like hostname) might require API calls that might hang Eclipse, so we should avoid using them. Other data (like DISPLAY) might be only available on some platforms (Linux/Mac) but not on others (Win).
So both kind of data should be optional and shouldn't break new code if missing.
Also new code should make sure it can work with lock files created by different platform versions, as it is possible to use same workspace with different Eclipse versions too.
Fixed via https://github.com/eclipse-platform/eclipse.platform.ui/pull/2347