Community
Participate
Working Groups
I20090922-0800 (I've also seen it with last weeks I-build but not for the previous few months). During PDE binary plug-in import (no targets running) I got a dialog (see attached picture) and the log entries below. After that my workspace had tons of errors because those plug-ins were not correctly imported. Sounds familiar? I thought this got fixed (and it looked fixed for quite some time). Trying to import the plug-ins again in the same session worked. There are two issues here: 1. PDE should re-try to delete the files (it's a known issue that deletion sometimes fails on WindowsXP) several times before giving up, see e.g. org.eclipse.jdt.testplugin.JavaProjectHelper.delete(IResource) in org.eclipse.jdt.ui.tests. 2. we need to find the code that locks the files. I know that APT changed some algorithms recently. Maybe that's the origin of the problem? !ENTRY org.eclipse.pde.ui 4 0 2009-09-23 09:31:28.900 !MESSAGE Problems detected while importing plug-ins !SUBENTRY 1 org.eclipse.core.resources 4 273 2009-09-23 09:31:28.900 !MESSAGE Could not delete 'C:\eclipse\workspaces\Development_HEAD\plugins\com.ibm.icu\com.ibm.icu_4.0.1.v20090822.jar'. !STACK 1 org.eclipse.core.runtime.CoreException: Problems encountered while deleting files. at org.eclipse.core.internal.filesystem.local.LocalFile.delete(LocalFile.java:124) at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFile(ResourceTree.java:303) at org.eclipse.core.internal.resources.ResourceTree.internalDeleteProject(ResourceTree.java:383) at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:832) at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1816) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:731) at org.eclipse.core.internal.resources.Project.delete(Project.java:309) at org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.createProject(PluginImportOperation.java:408) at org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.importPlugin(PluginImportOperation.java:190) at org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.runInWorkspace(PluginImportOperation.java:125) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Contains: Could not delete: C:\eclipse\workspaces\Development_HEAD\plugins\com.ibm.icu\com.ibm.icu_4.0.1.v20090822.jar. !SUBENTRY 2 org.eclipse.core.filesystem 4 273 2009-09-23 09:31:28.900 !MESSAGE Problems encountered while deleting files. !SUBENTRY 3 org.eclipse.core.filesystem 4 273 2009-09-23 09:31:28.900 !MESSAGE Could not delete: C:\eclipse\workspaces\Development_HEAD\plugins\com.ibm.icu\com.ibm.icu_4.0.1.v20090822.jar. !SUBENTRY 1 org.eclipse.core.resources 4 273 2009-09-23 09:31:28.900 !MESSAGE Could not delete 'C:\eclipse\workspaces\Development_HEAD\plugins\com.ibm.icu'. !SUBENTRY 1 org.eclipse.core.resources 4 273 2009-09-23 09:31:28.900 !MESSAGE Could not delete 'C:\eclipse\workspaces\Development_HEAD\plugins\javax.servlet\javax.servlet_2.5.0.v200806031605.jar'. !STACK 1 org.eclipse.core.runtime.CoreException: Problems encountered while deleting files. at org.eclipse.core.internal.filesystem.local.LocalFile.delete(LocalFile.java:124) at org.eclipse.core.internal.resources.ResourceTree.internalDeleteFile(ResourceTree.java:303) at org.eclipse.core.internal.resources.ResourceTree.internalDeleteProject(ResourceTree.java:383) at org.eclipse.core.internal.resources.ResourceTree.standardDeleteProject(ResourceTree.java:832) at org.eclipse.core.internal.resources.Resource.unprotectedDelete(Resource.java:1816) at org.eclipse.core.internal.resources.Resource.delete(Resource.java:731) at org.eclipse.core.internal.resources.Project.delete(Project.java:309) at org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.createProject(PluginImportOperation.java:408) at org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.importPlugin(PluginImportOperation.java:190) at org.eclipse.pde.internal.ui.wizards.imports.PluginImportOperation.runInWorkspace(PluginImportOperation.java:125) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Contains: Could not delete: C:\eclipse\workspaces\Development_HEAD\plugins\javax.servlet\javax.servlet_2.5.0.v200806031605.jar. !SUBENTRY 2 org.eclipse.core.filesystem 4 273 2009-09-23 09:31:28.900 !MESSAGE Problems encountered while deleting files. !SUBENTRY 3 org.eclipse.core.filesystem 4 273 2009-09-23 09:31:28.900 !MESSAGE Could not delete: C:\eclipse\workspaces\Development_HEAD\plugins\javax.servlet\javax.servlet_2.5.0.v200806031605.jar. !SUBENTRY 1 org.eclipse.core.resources 4 273 2009-09-23 09:31:28.900 !MESSAGE Could not delete 'C:\eclipse\workspaces\Development_HEAD\plugins\javax.servlet'.
Created attachment 147864 [details] Picture of problem dialog
Trying to find steps reveals that the problem is caused by APT not releasing files. Marking as critical as this not only breaks the import but results in resources being hold on to for nothing. 1. start with new workspace 2. disable auto-build 3. import 'com.ibm.icu' as binary plug-in project 4. check out 'org.eclipse.text' from CVS 5. clean and rebuild all 6. import existing unshared binary plug-ins ==> exception since files are locked Repeat above test case but after step 3 disable 'API Analysis Builder' on 'org.eclipse.text' ==> works as expected
The fZipFile in org.eclipse.pde.api.tools.internal.model.ArchiveApiTypeContainer is the issue as it keeps the archive open during my whole session and hence the importer cannot delete the JAR file.
Later the workspace baseline gets disposed which would close the ZIP file but at that point it's already too late.
Created attachment 148234 [details] Fix This fixes the issue for me and I don't think there's too much performance overhead by not caching the ZIP file itself.
(In reply to comment #5) > Created an attachment (id=148234) [details] > Fix > Thanks for the fix, but the attached patch is for TextMergeViewer.java :)
Created attachment 148235 [details] Fix
(In reply to comment #7) > Created an attachment (id=148235) [details] > Fix Thanks Dani, testing the patch I am getting 38 test failures in our non-plugin test suite and 6 failures in our plugin test suite. Most of the failures are around the search engine, I will investigate.
(In reply to comment #8) > ... and 6 failures in our plugin test suite. I misspoke, I got 26 failures in our plugin test suite.
The problem is coming from our getContents() and getInputStream() methods. When we close the zip file it also closes any open input streams to it. We should look at an alternate way to get class file contents from zip files instead of returning an input stream...continuing investigation...
>when we close the zip file it also closes any open input streams to it. Oh, right! Sorry about that.
Created attachment 148254 [details] proposed fix This patch builds on Dani's patch and tosses the getInputStream() method altogether and processes the stream in the getContents() method of each kind of ApiTypeRoot. This is a far safer approach than passing around open (potentially closed) input streams.
running the performance tests on the patch showed a small deviation, and we will likely have some yellow tests on our enum and annotation tests. Adding the performance tag so we don't forget about this.
applied last patch to HEAD, please verify Dani and Darin W
Patch looks good and fixes my problem.
Verified in I20091027-0100.