Bug 41137 - Cancel during delete is unresponsive
Summary: Cancel during delete is unresponsive
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Szymon Brandys CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2003-08-05 10:13 EDT by Oyvind Harboe CLA
Modified: 2007-08-07 11:39 EDT (History)
3 users (show)

See Also:
dj.houghton: review+


Attachments
Fix (1.48 KB, patch)
2007-07-10 17:15 EDT, Szymon Brandys CLA
no flags Details | Diff
Fix 02 (3.68 KB, patch)
2007-07-12 14:41 EDT, Szymon Brandys CLA
no flags Details | Diff
Fix 03 (3.52 KB, patch)
2007-07-12 19:26 EDT, Szymon Brandys CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oyvind Harboe CLA 2003-08-05 10:13:06 EDT
- I have a directory in one of my projects with many files(ca 8000).

- I delete the files using right click and selecting delete

- When I press cancel, it takes 30-40 seconds before Eclipse responds.
(It continues to churn during this time and does eventually exit as
expected).

Øyvind
Comment 1 Chris McLaren CLA 2005-12-12 16:57:33 EST
Reassigning to Platform-UI-Inbox (I left IBM 18 months ago..)
Comment 2 Michael Van Meekeren CLA 2006-03-27 15:08:25 EST
Is this delete from the Navigator or the Package Explorer?
Comment 3 Michael Van Meekeren CLA 2006-04-20 14:02:46 EDT
not for 3.2
Comment 4 Mike Wilson CLA 2007-06-21 16:08:33 EDT
Re-tested in R3.3. If you perform the delete in the Navigator, the resulting operation runs as a Job. Since I work with jobs set to run in background, I tested this by opening the progress view and clicking the "red square" to stop the job. Unfortunately, this did nothing, so we are effectively still broken in the way described by this bug. Since  we always complain when other teams don't properly allow their jobs to be cancelled, I'd like to see us fix this one.

I also tried this with the package explorer, which seems to have worse behavior. What I did was:
- create a new *simple* project
- drag an entire eclipse install into the project (just so I would have lots of files to delete)
- select the resulting resource directory in the project
- choose "Delete" from the pop up menu
- answer yes, when asked if you want to delete.

At this point, the "yes" button is grayed out, and a progress bar appears on the dialog along with the text "Checking pre-conditions" followed by "Performing action..." (not sure about the exact words of the last string). During the whole time the dialog is visible, the UI is unresponsive, even though this may take several minutes. Adding Martin to the bug to consider this last case.

Comment 5 Mike Wilson CLA 2007-06-21 16:17:30 EDT
At least in the Navigator case, I assume we are just calling the resource level delete operation with a progress monitor, which is ignored. Moving to Resources to either fix this or prove me wrong. ;-)
Comment 6 Martin Aeschlimann CLA 2007-06-22 03:52:56 EDT
The JDT UI problem with delete is bug 187351.
Comment 7 Szymon Brandys CLA 2007-07-10 17:15:10 EDT
Created attachment 73482 [details]
Fix
Comment 8 John Arthorne CLA 2007-07-11 16:59:17 EDT
This patch isn't enough.  When delete is canceled, the resource ends up being out of sync.  Here are steps to try:

1) Create a folder with lots of contents (I unzipped an Eclipse build into the folder and then refreshed in the UI)
2) Delete the folder
3) After the delete has started to show some progress, cancel the job
4) Now try to copy the folder

-> An error occurs saying the folder is out of sync.

We need to catch the operation cancelation in ResourceTree.internalDeleteFolder,  do a refresh local on the folder, and then rethrow the cancelation exception. Szymon, can you try doing this. See me for any questions.
Comment 9 Szymon Brandys CLA 2007-07-12 14:41:26 EDT
Created attachment 73691 [details]
Fix 02
Comment 10 Szymon Brandys CLA 2007-07-12 15:46:08 EDT
I marked Fix 02 as obsolete because it broke one of the workspace tests. I have to investigate it. It possible that the test should be changed.
Comment 11 Szymon Brandys CLA 2007-07-12 19:26:26 EDT
Created attachment 73710 [details]
Fix 03

The problem with tests occurred because before it was assumed, that in case of CoreException during deleting the workspace will be out of sync. In the patch Fix 02 the workspace was synchronized always, even in case of these CoreExceptions.
Comment 12 DJ Houghton CLA 2007-07-17 11:24:25 EDT
Reviewed and released. Thanks.
Comment 13 Michael Valenta CLA 2007-08-07 11:39:47 EDT
Verified in I20070807-0010. However, in some cases, there was still a noticeable delay between when I hit cancel and when the operation stopped (~15 seconds). Perhaps this was due to updating the tree but the messages being printed still indicated that deletions were occurring. I also noticed that there was more of a delay if I canceled the operation early (as opposed to after it ran for a while).