Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355476

Summary: Frequent error deleting many workspace projects on Windows
Product: [Eclipse Project] Platform Reporter: Nicolas Bros <nicolas.bros>
Component: ResourcesAssignee: Platform-Resources-Inbox <platform-resources-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
stacktrace none

Description Nicolas Bros CLA 2011-08-23 05:17:50 EDT
Most of the time, when I try to delete say 50 projects in my workspace at once, I get an error:
"An exception has been caught while processing the refactoring 'Delete Resource'."
And I only have the choice to Abort or Undo.

Even if I try again, selecting all projects, clicking Delete, selecting "Delete project contents on disk", the same error happens again and again.
It only works if I delete the projects in small groups of 10 or so.

I suspect this is a Windows-specific problem, since I have often seen "locked" files even outside Eclipse.

Since it works eventually when deleting projects in small numbers, I think the delete wizard could offer "Retry" and "Ignore" options.

Or maybe be more intelligent about the way it deletes files: retrying automatically, and maybe scheduling the "locked" files for deletion and moving them somewhere else (temp?) in the meantime?
Comment 1 Remy Suen CLA 2011-08-23 06:16:04 EDT
(In reply to comment #0)
> Most of the time, when I try to delete say 50 projects in my workspace at once,
> I get an error:
> "An exception has been caught while processing the refactoring 'Delete
> Resource'."
> And I only have the choice to Abort or Undo.

Having the error logs for these problems would likely help diagnose the cause.

You may want to try closing the projects first before deleting them, that may help.
Comment 2 Nicolas Bros CLA 2011-08-23 08:39:56 EDT
Created attachment 201991 [details]
stacktrace

Here is the stacktrace. It points to the folders that can't be deleted, but offers no indication as to why they can't be deleted. That may be because they are open in a file explorer, locked by the antivirus, copied by a backup utility, being accessed by Eclipse itself...
I don't know if Windows has an API for knowing which process is locking a file, but if it has maybe Eclipse could use it to provide more information.

> You may want to try closing the projects first 
> before deleting them, that may help.

Thank you for the tip. I'll try it next time.
But if that is really the solution, maybe Eclipse could do it itself?
Also, maybe Eclipse could prevent access through its file API (IResource, etc.) to files and folders in projects that are being deleted?
Comment 3 Nicolas Bros CLA 2011-08-29 04:48:08 EDT
> You may want to try closing the projects first 
> before deleting them, that may help.
I tried it today: it still took 5 tries to delete 30 plug-ins when I try to delete all 30 at once.
Comment 4 Lars Vogel CLA 2019-11-14 03:40:02 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.