[ 
https://issues.apache.org/jira/browse/SLING-709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Felix Meschberger updated SLING-709:
------------------------------------

    Description: 
The BundleResourceProcessor employs a mix of bundle management and package 
admin tasks, which may cause the framework to get into uncontrolled states:

(1) installOrUpdate may update existing bundles. This causes the bundle to be 
stopped, updated and started
(2) processResourceQueue calls PackageAdmin.resolve for installed bundles
(3) processResourceQueue starts resolved bundles
(4) processResourceQueue calls PackageAdmin.refreshPackages repeatedly

This all calls way to much into the framework bundle resolution and may be 
greatly simplified and stabilized:

(1) when a bundle is to be updated it should be stopped before being updated. 
It will be started later
(2) processResourceQueue only calls refreshPackages if bundles have been 
uninstalled or updated since the last processResourceQueue
(3) if packages are refreshed the BundleResourceProcessor waits for the refresh 
to finish and starts any bundles stopped during package refresh as well as 
newly installed and updated bundles and lets the framework decide on resolution.

  was:
The RepositoryObserver thread scans the configured repository locations for 
new, modified and removed resources. If such resources are found, the 
OSGiController is notified, which takes immediate action. This causes bundle 
changes (installation, update, removal, start etc.) to be mixed within short 
time frames and may cause massive concurrency issues. This is generally not a 
problem in a running system.

In a freshly started system, this may cause some problems. Therefore I suggest 
the RepositoryObserver puts the OSGiController into "queueing mode" while 
scanning all folders. After the scan is done, the OSGiController is reset into 
normal mode, where it will then run the queued actions.

In turn, the OSGiController should not run its PendingBundles queue, while it 
is processing the resource which have been queued during "queueing mode".

        Summary: Synchronization issues while managing bundles  (was: Bundle 
changes should be queue while scanning all watched folders)

> Synchronization issues while managing bundles
> ---------------------------------------------
>
>                 Key: SLING-709
>                 URL: https://issues.apache.org/jira/browse/SLING-709
>             Project: Sling
>          Issue Type: Improvement
>          Components: JCR Install
>    Affects Versions: JCR Install 2.0.4
>            Reporter: Felix Meschberger
>            Assignee: Bertrand Delacretaz
>             Fix For: JCR Install 2.0.4
>
>
> The BundleResourceProcessor employs a mix of bundle management and package 
> admin tasks, which may cause the framework to get into uncontrolled states:
> (1) installOrUpdate may update existing bundles. This causes the bundle to be 
> stopped, updated and started
> (2) processResourceQueue calls PackageAdmin.resolve for installed bundles
> (3) processResourceQueue starts resolved bundles
> (4) processResourceQueue calls PackageAdmin.refreshPackages repeatedly
> This all calls way to much into the framework bundle resolution and may be 
> greatly simplified and stabilized:
> (1) when a bundle is to be updated it should be stopped before being updated. 
> It will be started later
> (2) processResourceQueue only calls refreshPackages if bundles have been 
> uninstalled or updated since the last processResourceQueue
> (3) if packages are refreshed the BundleResourceProcessor waits for the 
> refresh to finish and starts any bundles stopped during package refresh as 
> well as newly installed and updated bundles and lets the framework decide on 
> resolution.

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

Reply via email to