John Ross created ARIES-1399:
--------------------------------

             Summary: Trunk fails OSGi R6 CT
                 Key: ARIES-1399
                 URL: https://issues.apache.org/jira/browse/ARIES-1399
             Project: Aries
          Issue Type: Bug
            Reporter: John Ross
            Assignee: John Ross


The Subsystems implementation is currently failing three tests in the R6 CT as 
a result of some of the recent performance tunings:

org.osgi.test.cases.subsystem.junit.SharingPolicySubsystemTests.test3A1a_BundleIsolationApplication
org.osgi.test.cases.subsystem.junit.SharingPolicySubsystemTests.test3A1b_BundleIsolationFeatures
org.osgi.test.cases.subsystem.junit.SharingPolicySubsystemTests.test3A1a_BundleIsolationComposite

It fails all three for the same reason. The tests explicitly install a bundle 
using the region bundle context of the root subsystem. The bundle is 
subsequently started. Using a synchronous bundle listener, the tests reasonably 
expect to see INSTALLED, RESOLVED, STARTING, and ACTIVE bundle events. However, 
the RESOLVED event is missing. It is missing because:

(1) The Bundle Event Hook, registered with a service ranking of 
Integer.MAX_VALUE, correctly identifies the event as pertaining to an 
explicitly installed bundle and acts accordingly.
(2) As normal, the bundle is wrapped by a Bundle Revision Resource in order to 
compute the service capabilities and requirements if the Application Modeller 
service is present. Previously, the capabilities and requirements were not 
cached but (lazily) computed with each request. Today, they are computed once 
and cached at instantiation.
(3) Computing the service capabilities and requirements requires searching for 
Blueprint XML files through Bundle.findEntries which results in the framework 
attempting to resolve the bundle.
(4) Region Digraph, through its own bundle event hook, receives the RESOLVED 
event before the INSTALLED event. Because this is an unknown bundle, the event 
is filtered and not delivered to any listeners, synchronous or otherwise.

There are at least a few possible solutions to the problem.

(1) Have the Bundle Event Hook explicitly add the bundle to the region using 
Region.addBundle(Bundle) as part of handling the INSTALLED event. This would 
(+) solve the immediate issue but (-) promote out of order event delivery to 
other hooks and listeners.
(2) Prevent bundles under these circumstances from resolving altogether. This 
would (+) solve the immediate issue and (+) prevent out of order event 
delivery, but (-) eliminate the possibility of searching fragment bundles for 
Blueprint XML files. 
(3) Lazily compute service dependencies and requirements in Bundle Revision 
Resource as before but still cache them. This would (+) solve the immediate 
issue, (+) resemble how things already were before performance tuning, (+) not 
contribute to out of order event delivery, and (+) leave open the possibility 
of searching fragments for Blueprint XML files.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to