DESCRIPTION

[RFC] Prompt to delete lock when operation fails

This begins the work to prompt the user to delete the .lock
file left over by a crashed process that was holding it.

A new LockOperation is added that wraps an IEGitOperation
and prompts the user to delete the lock failure being reported
in a wrapped CoreException.

This commit only currently modified ResetCommand but if this
approach  works then other commands can begin wrapping
core operations in a LockOperation.

Bug: 360141
Change-Id: Icdd58cc2d7606b23ca1cac550ca287f94f072312


COMMENTS

author: Jaidyn Nichols
date: 2012-01-11 22:58:50.000000000

Uploaded patch set 8.

-------------------------------------
author: Brenden Conley
date: 2012-01-11 22:58:55.000000000

Patch Set 8:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/2298/ 

-------------------------------------
author: Brenden Conley
date: 2012-01-11 23:14:43.000000000

Patch Set 8: I would prefer that you didn't submit this

Build Unstable 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/2298/ : UNSTABLE

-------------------------------------
author: Marlie Beasley
date: 2012-01-12 09:40:15.000000000

Patch Set 8:

What do you think about the following alternative approach: An action is added to Repositories View that allows the user to unlock the Index.
This implies some extra clicks for the user but it avoids the problems that Jobs send a UI and that operations need to be wrapped by LockOperation.
I think the extra clicks are acceptable because hanging index locks do not occur often.

-------------------------------------
author: Jaidyn Nichols
date: 2012-01-12 18:37:17.000000000

Patch Set 8:

> What do you think about the following alternative approach: An action is added to Repositories View that allows the user to unlock the Index. This implies some extra clicks for the user but it avoids the problems that Jobs send a UI and that operations need to be wrapped by LockOperation. I think the extra clicks are acceptable because hanging index locks do not occur often.

I am unsure if adding an action to the repository menu that is very advanced and (hopefully) rarely used is the right move.

If if it was moved to an action, it would still require adding a custom dialog to inform them of the situation since the current dialog is the default one for any exception that is thrown and isn't very helpful about what caused the situation and how it can be remedied.  So if a custom dialog is needed to inform them of the situation then it seems better to have them act on it from that dialog.

I have updated the change to no longer do the prompt in a syncExec so it won't be holding any locks now when the user is informed.

Another remaining piece is whether the lock deletion should be scheduled in a job with a scheduling rule that ensures no other jobs could be running that are performing operations that require an index lock.

-------------------------------------
