Bug 178027

Summary: Thread-unsafe manipulation of UserLibraryManager#listener within UserLibraryManager#internalSetUserLibrary
Product: [Eclipse Project] JDT Reporter: Maxime Daniel <maxime_daniel>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: Olivier_Thomann
Version: 3.2.2   
Target Milestone: 3.6 M1   
Hardware: PC   
OS: All   
Whiteboard:

Description Maxime Daniel CLA 2007-03-19 06:26:50 EDT
Source based, R3_2_maintenance stream.

This is a fup on bug 154984. internalSetUserLibrary removes then re-adds a listener from the property changes listeners, potentially missing some changes in the interim. Except if another mechanism strikes that would tell the caller that the library needs to be refreshed, this is due to lead to wrong library contents in some cases. 
A potential path for a solution would be to tell the listener to queue the change events for a while, then pick up any changes when the work that needs the listener not to interfere is done. (Caveats: change events may be destroyed in  the interim, hence the listener should copy the information it needs from them; multiple threads may ask the listener to suspend real changes, which introduces a contention - the ultimate solution may hence be quite different than what I suggest here).
Comment 1 Olivier Thomann CLA 2009-06-25 15:20:00 EDT
Srikanth, please investigate if this is still accurate.
If not, close as WORKSFORME.
Thanks.
Comment 2 Srikanth Sankaran CLA 2009-07-06 05:08:14 EDT
The piece of code identified by comment#0 no longer exists.
(went away with the rewrite referred to by bug# 183117 
comment# 17)

Closing this as WORKSFORME (rather than as DUPLICATE, since
bug# 183117 appears to be a rewrite larger in scope than just
the issue identified here)

Comment 3 Frederic Fusier CLA 2009-08-04 07:13:58 EDT
Verified for 3.6M1