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

Bug 360105

Summary: [DS] SCRManager waits too long to enable components
Product: [Eclipse Project] Equinox Reporter: Jens Kuebler <kuebler>
Component: CompendiumAssignee: Stoyan Boshev <s.boshev>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tjwatson
Version: unspecified   
Target Milestone: Juno M4   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
proposed patch none

Description Jens Kuebler CLA 2011-10-06 10:35:43 EDT
Build Identifier: I20110613-1736

In case many components get activated on start up, the start time of eclipse significantly rises.
The reason is the Service Component Manager that sleeps for too long in case components get activated very fast.

SCRManager#startedBundle:
components.wait(1000);

a components.wait(10) suffices

Reproducible: Always
Comment 1 Thomas Watson CLA 2011-10-06 11:29:01 EDT
I would have thought the wait is waiting for a notification from another thread.  From what you state it sounds like this is not happening.
Comment 2 Jens Kuebler CLA 2011-10-06 11:39:01 EDT
Yes sometimes the 
workObject.notify()
in SCRManager#performWork
executes before the wait so it will wait the 1000msecs
Comment 3 Thomas Watson CLA 2011-10-06 14:13:00 EDT
(In reply to comment #2)
> Yes sometimes the 
> workObject.notify()
> in SCRManager#performWork
> executes before the wait so it will wait the 1000msecs

Then something is not right in the logic.  Shouldn't the loop use a while(condition)->do instead of do->while(condition)?  This way you avoid waiting when there is no longer anything to wait for.
Comment 4 Stoyan Boshev CLA 2011-10-07 02:06:04 EDT
(In reply to comment #3)
> Then something is not right in the logic.  Shouldn't the loop use a
> while(condition)->do instead of do->while(condition)?  This way you avoid
> waiting when there is no longer anything to wait for.

Yes, we can switch the "do-while" to "while" loop to fix this bug
Comment 5 Thomas Watson CLA 2011-10-07 11:23:41 EDT
(In reply to comment #4)
> (In reply to comment #3)
> > Then something is not right in the logic.  Shouldn't the loop use a
> > while(condition)->do instead of do->while(condition)?  This way you avoid
> > waiting when there is no longer anything to wait for.
> 
> Yes, we can switch the "do-while" to "while" loop to fix this bug

Thanks Stoyan, I will mark this for juno.  Please release a fix when you have it.
Comment 6 Stoyan Boshev CLA 2011-11-17 09:00:44 EST
Created attachment 207144 [details]
proposed patch

Adding the discussed change as patch
Comment 7 Stoyan Boshev CLA 2011-11-21 04:29:17 EST
The patch is released in HEAD