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

Bug 362730

Summary: Viewing an OSGi state dump fails
Product: [RT] Virgo Reporter: Glyn Normington <glyn.normington>
Component: web-adminAssignee: Chris Frost <eclipse>
Status: CLOSED FIXED QA Contact: Project Inbox <virgo-inbox>
Severity: normal    
Priority: P3 CC: eclipse, tjwatson
Version: 3.0.1.RELEASE   
Target Milestone: 3.6.0.M01   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 352217, 361905    
Bug Blocks:    

Description Glyn Normington CLA 2011-11-02 17:57:57 EDT
This bug continues the work on bug 361905 which produced a fix in the Equinox region bundle.

Steps to recreate:
1. Unzip the dump in https://bugs.eclipse.org/bugs/attachment.cgi?id=205904 and place it in a fresh unzip of 3.0.1.RELEASE of Virgo-Tomcat.
2. Go to the Admin console and try and view the state dump in the OSGi viewer.
3. The Admin console will report an error the log will show an NPE.

The dump was created on a recent build of Virgo using version 1.0.0.v20110503
of the region bundle. Chris attempted to deploy a bundle from Jetty that failed to
deploy and resulted in the dump attached. When the dump occurred the log
correctly showed a resolver resolution report.
Comment 1 Glyn Normington CLA 2011-11-07 11:58:26 EST
The bug is caused during analysis of the state dump by Virgo.

StandardStateHolder uses an instance of StandardStateService to read the OSGi state dump, but the StandardStateService instance refers to the live region digraph and so when StandardStateHolder uses the StandardStateService instance to access region related information, this gives the wrong results because it knows nothing of the coregion (used to hold temporary bundle ids created during the "side state" resolution process).

The precise solution is not yet clear, but it will involve accessing region information via a QuasiFramework instance which has been loaded with the dumped region digraph.
Comment 2 Glyn Normington CLA 2011-11-08 06:33:02 EST
The approach to browsing OSGi state dumps in the admin console is changing radically under bug 360993. When that bug has been implemented, this bug should be fixed. Therefore no further work is planned on this bug as it would be a waste of effort.
Comment 3 Thomas Watson CLA 2011-11-08 08:34:10 EST
(In reply to comment #2)
> The approach to browsing OSGi state dumps in the admin console is changing
> radically under bug 360993. When that bug has been implemented, this bug should
> be fixed. Therefore no further work is planned on this bug as it would be a
> waste of effort.

Out of curiosity, did the bug 361905 contribute to this issue and is that fix in bug 361905 needed for the changes discussed in bug 360993 to properly work?
Comment 4 Glyn Normington CLA 2011-11-08 08:50:47 EST
(In reply to comment #3)
> (In reply to comment #2)
> > The approach to browsing OSGi state dumps in the admin console is changing
> > radically under bug 360993. When that bug has been implemented, this bug should
> > be fixed. Therefore no further work is planned on this bug as it would be a
> > waste of effort.
> 
> Out of curiosity, did the bug 361905 contribute to this issue and is that fix
> in bug 361905 needed for the changes discussed in bug 360993 to properly work?

Good questions!

The answers are: no and no. The only contribution of bug 361905 to this issue is the confusion factor caused by the broken invariant in the "live" digraph (which is -- the subject of this bug -- confused with the digraph reconstituted from the dump).

Bug 361905 breaks the invariant of the "live" digraph by leaving bundleId->Region mappings around for regions(*) which have been removed. When the digraph is persisted and read back in, the bundleId->Region mapping is reconstructed from the region contents and so any effects of bug 361905 are removed from the reconstituted digraph.

* - only one region, the "coregion", is actually removed. It is repeatedly created and removed, each time the deployment pipeline runs.
Comment 5 Glyn Normington CLA 2011-11-21 05:45:11 EST
Once the Equinox region bundle is upgraded to pick up the fix to bug 361905, all that remains to do is to fix the admin app code which uses the wrong instance of the region digraph. However, this code will be deleted by bug 360993, so once bug 360993 is fixed, this bug should also be verified and closed.
Comment 6 Chris Frost CLA 2012-08-22 13:19:52 EDT
New Admin Console is merged in to the Kernel complete with a state dump viewer.