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

Bug 319401

Summary: During shutdown StartupTracker throws exceptions logging events.
Product: [RT] Virgo Reporter: Steve Powell <zteve.powell>
Component: unknownAssignee: Steve Powell <zteve.powell>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Steve Powell CLA 2010-07-09 10:43:27 EDT
org.eclipse.virgo.kernel.core.StartupTracker has a private Runnable class StartupTrackingRunnable.

In turn, this has a private method logEvent(...) which throws exceptions sometimes because the context (this.context in the Runnable instance) becomes invalid (in the process of shutting down for example).

There is no sure-fire cure for this (except to somehow guarantee early logging first before we shutdown), but this bug is to make this code tolerate the errors rather than barfing all over the console.
Comment 1 Steve Powell CLA 2010-07-09 12:36:32 EDT
I'm looking at this one already.
Comment 2 Steve Powell CLA 2010-07-09 12:59:30 EDT
Made changes to startupTracker to isolate the running thread from changes, and to make the Runnable a static inner class.

Rather than getting the eventAdmin and eventLogger every time, the services are obtained early and only ungot when the startupTracker stops. This might fail, but is guarded to ignore failures which might occur during clean-up.

One of the startupTracker tests is re-enabled because the wait-time is not fixed at  one hour (as the @Ignore comment claims) and the test  passes easily in the new incarnation.

This bugzilla will be closed when the fix is reviewed.
Comment 3 Steve Powell CLA 2010-08-06 04:12:19 EDT
Done.