Bug 572684 - PDE is locking files on a directory-based target platform
Summary: PDE is locking files on a directory-based target platform
Status: CLOSED DUPLICATE of bug 567661
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.10   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PDE-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2021-04-08 06:27 EDT by Pit Friedrich CLA
Modified: 2021-06-03 08:43 EDT (History)
1 user (show)

See Also:


Attachments
Example Workspace (3.94 KB, application/x-zip-compressed)
2021-04-09 09:11 EDT, Pit Friedrich CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pit Friedrich CLA 2021-04-08 06:27:31 EDT
When a full build is executed, (I suppose) PDE is loading the JARs of the target platform. But somehow the file handles of the JARs are not released sometimes. So deleting or updating these JARs during runtime of Eclipse is not possible.

Tests I did:
- removing some Target definitions from the TP: the files are obviously not locked anymore
- changing the TP during runtime: the files are not locked
- analyzed open file handles with ProcessExplorer and Handle.exe (by Sysinternals): the file handles are opened during build phase and sometimes not closed afterwards.

This issue didn't occur in 4.9. Since this happens infrequently, I assume it's a concurrency issue (?).
Comment 1 Pit Friedrich CLA 2021-04-09 04:13:53 EDT
After further tests:
- Restarting the IDE doesn't help. The file lock persists most of the times.
- same problem with 2018-12 (4.10)
- the issue doen't occur in 2018-09 (4.9)
Comment 2 Andrey Loskutov CLA 2021-04-09 07:05:43 EDT
Please provide simple project with simple example of the target platform that shows the problem.
Comment 3 Pit Friedrich CLA 2021-04-09 09:11:25 EDT
Created attachment 286072 [details]
Example Workspace

As mentioned the lock doesn't always occur. Restarting the IDE and reloading the target platform can provoke the issue.
Comment 4 Pit Friedrich CLA 2021-06-03 08:21:55 EDT
As it turned out it's not PDE's fault that JAR file handles are sometimes not released. It was a problem inside JDT
Comment 5 Pit Friedrich CLA 2021-06-03 08:23:41 EDT
As it turned out, it is not PDE's fault that JAR file handles are sometimes not released. It was a problem inside JDT: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=567661. 
This problem persisted from 4.10 to 4.18. It was fixed with release 4.19.
Closed.
Comment 6 Andrey Loskutov CLA 2021-06-03 08:43:53 EDT

*** This bug has been marked as a duplicate of bug 567661 ***