[ 
https://issues.apache.org/jira/browse/SLING-3386?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13897973#comment-13897973
 ] 

Felix Meschberger commented on SLING-3386:
------------------------------------------

To be honest, I don't like to have feature working on a best effort basis and I 
don't really like this approach.

But looking at the actual problem: we have to install the logging bundle as 
soon as possible, that as the first or second bundle. We once had that when 
logging was basically the only bundle in start level 1. At this time, this 
start level is pretty much overcrowded and logging will not be started 
appropriately.

So, maybe we have two options:

* treat logging specially in that we define a new "folder" which is handled 
first by the bootstrap installer
* move all non-logging bundles from startlevel 1 to startlevel 2

If you insist on the patch, here is some feedback: The 
BundleStartLevelSorter.parseStartOrder may throw an exception if the header 
happens to not be an Integer. Also every reference to start order (or even 
start level in that method) would have to be rephrased to install order. Also, 
I would call the header "X-Sling-Bootstrap-Install-Order" to indicate it is 
just the bootstrap installer respecting this as the installation order.

> Enable support starting bundle in custom oreder at start level 1
> ----------------------------------------------------------------
>
>                 Key: SLING-3386
>                 URL: https://issues.apache.org/jira/browse/SLING-3386
>             Project: Sling
>          Issue Type: Improvement
>          Components: Launchpad
>    Affects Versions: Launchpad Base 2.5.0
>            Reporter: Chetan Mehrotra
>            Priority: Minor
>         Attachments: SLING-3386.patch
>
>
> By default OSGi framework does not define the order in which bundles would be 
> started in a given start level. The only way is to use to use start level.
> However in case of bundle like Logging its desriable that Log bundle is the 
> first bundle to start in the system such that it does not miss any log 
> message. The problem is described in more details at SLING-3340.
> As Sling uses Felix framework by default it is possible to control the start 
> order by controlling the order in which bundles are installed on the 
> framework. As per current Felix Framework implementation [1] bundle within 
> same start level are started in the order of bundleId.
> The way patch works is
> 1. Bundle which start at start level 1 can define a header 
> 'X-Sling-Start-Order' to provide a start order hint. Lower the level then 
> earlier the bundle would be started
> 2. BootstrapInstaller would sort the files obtained from directly listing 
> based on this header. 
> 3. Sorted list would be used to install the bundles
> I understand that this is a very much implementation specific fix and might 
> not work if Felix changes the internal logic. But then the feature is meant 
> to be used in best effort basis!!.
> [1] 
> https://github.com/apache/felix/blob/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java#L4873



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to