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

John Ross updated ARIES-1109:
-----------------------------

    Description: 
Currently, AriesSubsystem-LastId is only persisted when the subsystems bundle 
is stopped. It will not be persisted, for example, when System.exit is called 
or some sort of crash occurs.

There are at least three options.

(1) Add a JVM shutdown hook.

(2) Persist the last ID with each subsystem installation.

(3) Periodically persist the last ID in a background thread (i.e. batch the 
installations).

---------------------------------------------------------------------------

aries subsystems will generate duplicate subsystem ids if the subsystem core 
bundle (or the container) is restarted.

Reproduction is quite easy:
1. install a subsystem -> this will get subsystem id 1
2. stop the org.apache.aries.subsystem.core bundle (or the OSGi container)
3. start the org.apache.aries.subsystem.core bundle (or the OSGi container)
-> the subsystem installed in step 1 is still there and has id 1
4. Install another subsystem (different from the first)
-> This will also get Id 1

I think the error is in line 150 of the 
org.apache.subsystems.core.internal.Subsystems class. There the static lastId 
counter of the SubsystemIdentifier class is set to 0 before actually populating 
the root subsystem.

Maybe this should be set to the maximum id of the installed subsystems during 
or after the population of the root subsystem

  was:
aries subsystems will generate duplicate subsystem ids if the subsystem core 
bundle (or the container) is restarted.

Reproduction is quite easy:
1. install a subsystem -> this will get subsystem id 1
2. stop the org.apache.aries.subsystem.core bundle (or the OSGi container)
3. start the org.apache.aries.subsystem.core bundle (or the OSGi container)
-> the subsystem installed in step 1 is still there and has id 1
4. Install another subsystem (different from the first)
-> This will also get Id 1

I think the error is in line 150 of the 
org.apache.subsystems.core.internal.Subsystems class. There the static lastId 
counter of the SubsystemIdentifier class is set to 0 before actually populating 
the root subsystem.

Maybe this should be set to the maximum id of the installed subsystems during 
or after the population of the root subsystem

        Summary: Consider making the persistence of AriesSubsystem-LastId more 
robust.  (was: Duplicate subsystem ids after restart of subsystem.core)
    
> Consider making the persistence of AriesSubsystem-LastId more robust.
> ---------------------------------------------------------------------
>
>                 Key: ARIES-1109
>                 URL: https://issues.apache.org/jira/browse/ARIES-1109
>             Project: Aries
>          Issue Type: Bug
>          Components: Subsystem
>            Reporter: Stephan Siano
>         Attachments: a.esa, b.esa, c.esa
>
>
> Currently, AriesSubsystem-LastId is only persisted when the subsystems bundle 
> is stopped. It will not be persisted, for example, when System.exit is called 
> or some sort of crash occurs.
> There are at least three options.
> (1) Add a JVM shutdown hook.
> (2) Persist the last ID with each subsystem installation.
> (3) Periodically persist the last ID in a background thread (i.e. batch the 
> installations).
> ---------------------------------------------------------------------------
> aries subsystems will generate duplicate subsystem ids if the subsystem core 
> bundle (or the container) is restarted.
> Reproduction is quite easy:
> 1. install a subsystem -> this will get subsystem id 1
> 2. stop the org.apache.aries.subsystem.core bundle (or the OSGi container)
> 3. start the org.apache.aries.subsystem.core bundle (or the OSGi container)
> -> the subsystem installed in step 1 is still there and has id 1
> 4. Install another subsystem (different from the first)
> -> This will also get Id 1
> I think the error is in line 150 of the 
> org.apache.subsystems.core.internal.Subsystems class. There the static lastId 
> counter of the SubsystemIdentifier class is set to 0 before actually 
> populating the root subsystem.
> Maybe this should be set to the maximum id of the installed subsystems during 
> or after the population of the root subsystem

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to