felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sahoo (JIRA)" <j...@apache.org>
Subject [jira] Created: (FELIX-1851) FileInstall watched bundles are restarted twice upon update
Date Thu, 05 Nov 2009 18:17:32 GMT
FileInstall watched bundles are restarted twice upon update

                 Key: FELIX-1851
                 URL: https://issues.apache.org/jira/browse/FELIX-1851
             Project: Felix
          Issue Type: Bug
          Components: File Install
    Affects Versions: fileinstall-1.2.0
         Environment: generic
            Reporter: Sahoo

I am observing that bundles watched by fileinstall (1.2.0) are getting stopped & subsequently
started twice when they are updated. First time, they are stopped and started by a call to
update() and then because of a call to refreshPackages(). The scenario where this is happening
is given below:

bundle A exports package p and is tracking service of type p.Foo.
bundle B imports a package p from A. It exports a service object with the service interface

I am updating bundle A and it is getting stopped and started twice.

The explanation given to me (thanks to Richard) is that:

"The update operation is defined as first stopping a bundle and restarting it after the update.
This is once.

Since an updated bundle is not really updated until it is refreshed, when you refresh, bundle
A's update is finalized by being refreshed, which causes it to stop and restart. This is twice.

If bundle A was not being used, Felix would optimize this and do the refresh as part of the
update, so it would only happen once.

If File Install always refreshes after an update, it would be better to change it to first
stop all bundles being updated, then update all bundles, then refresh, then restart all updated
bundles. This way they would only stop/restart once."

I am not sure if the behavior has changed in newer version of fileinstall or not. If not,
this will be a good change to make.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message