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

Bug 314706

Summary: Many errors after import
Product: [Eclipse Project] PDE Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: curtis.windatt.public, darin.eclipse, john.arthorne, markus.kell.r
Version: 3.6Flags: markus.kell.r: review+
curtis.windatt.public: review+
daniel_megert: review+
Target Milestone: 3.6 RC3   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
patch none

Description Dani Megert CLA 2010-05-27 11:36:17 EDT
I20100526-1625.

After importing all binary plug-ins I get many errors in my workspace. Clean All does not help (auto-build is on). Cleaning individual plug-ins one by one works if one finds out the right order to do this. Also, restoring the target platform to defaults fixes the issue until the next import is performed.

So far Darin and I can only reproduce on Linux.
Comment 1 Markus Keller CLA 2010-05-27 12:18:38 EDT
Reproduced with I20100520-1744 on Linux. First import was OK, but the second import produced errors again (nothing in the log).
Comment 2 Darin Wright CLA 2010-05-27 12:40:33 EDT
The problem appears to come from the fix to bug 309894. Examining the fix to that bug revealed an problem with the code. Will attach patch shortly.
Comment 3 Darin Wright CLA 2010-05-27 12:48:06 EDT
Created attachment 170227 [details]
patch

The previous code was using constants from the wrong event class to detect add/remove of bundles. This patch limits asynch updates to change events only (generated when saving a manifest editor). All other updates are performed synchronously (to ensure the same behavior as 3.5 and previous).
Comment 4 Darin Wright CLA 2010-05-27 12:50:40 EDT
I suspect the reason we see different behavior on linux vs. windows is related to the speed of the file operations. If the deletion/creation is faster on linux the deltas being created will be different, executing potentially different code paths or different number of update sequences.
Comment 5 Darin Wright CLA 2010-05-27 12:56:47 EDT
Marking as RC3 candidate, will ask for review after we do some more review ourselves.
Comment 6 Markus Keller CLA 2010-05-27 14:07:51 EDT
Patch looks good (based on my limited understanding of the PDE code base).

I've tested the patch with I20100526-1625 and then updated to I20100527-0800+patch. Both importing and compiling went well (several times) on the Linux machine where it failed often before.

I again ran into bug 314419 once (with I20100526-1625+patch), but that seems to be a different issue.

+1 for RC3.
Comment 7 Darin Wright CLA 2010-05-27 15:03:38 EDT
My findings with the old code (i.e. without the patch) show that plug-in import ends up with compilation errors when a combination of synchronous and asynchronous updates occurr with classpath containers. When all updates are either synch or asynch I end up with no compilation errors. Looking at the classpath container API (JavaCore.setClasspathContainer(...)) and SetContainerOperation, there definitely is code that avoids updates to the same container already being updated. This leads me to suspect that our asynch and synch calls end up executing at the same time leaving the Java model in a bad state (since the classpaths do actually look correct, and manually cleaning/building single projects in the correct order does clean things up).
Comment 8 Dani Megert CLA 2010-05-27 15:39:14 EDT
What Markus and Darin said makes sense. The code change also makes sense to me. I would like to see some new tests for that bug that can wait (please file a new bug for that).

+1 for RC3.
Comment 9 Curtis Windatt CLA 2010-05-27 15:40:29 EDT
+1

I was able to reproduce the problem, applying the patch fixed the issue (even after trying several imports).

Fix makes sense.  The last time I looked at the code something seemed wrong with how the flags were checked, but everywhere else in PDE we were treating the flags the same (as an int constant rather than a bit mask).  Turns out we were using the wrong event flags.
Comment 10 Curtis Windatt CLA 2010-05-27 15:42:52 EDT
Fixed in HEAD.
Comment 11 Markus Keller CLA 2010-05-28 10:36:18 EDT
Verified in I20100527-1700.