Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConfigurationServiceImpl creates duplicate instances #1016

Closed
ctron opened this issue Jan 16, 2017 · 5 comments
Closed

ConfigurationServiceImpl creates duplicate instances #1016

ctron opened this issue Jan 16, 2017 · 5 comments

Comments

@ctron
Copy link
Contributor

ctron commented Jan 16, 2017

On startup the Kura ConfigurationServiceImpl does re-create all factory configurations. This results in duplicate service instances. Adding one more for each start.

The reason why this does not manifest into a problem is that Kura forces Equinox to clear the configuration area when starting up.

However this makes the OSGi ConfigAdmin effectively non-persistent and doesn't allow any non-Kura configuration to be stored. It also does not work on Karaf.

@ctron ctron added the bug label Jan 16, 2017
@ctron ctron added this to the KURA-3.0.0 milestone Jan 16, 2017
@cdealti cdealti removed this from the KURA-3.0.0 milestone Mar 15, 2017
@cdealti
Copy link
Contributor

cdealti commented Feb 15, 2018

@ctron it might be temporarily fixed by checking the Equinox clean start property and avoiding updating the configurations read from the snapshot 0. For some historical reasons (corruption of the OSGi storage are) at Eurotech, clean start has always been the choice for embedded systems.
Things may have changed and we should verify if this is till the case.

@cdealti
Copy link
Contributor

cdealti commented Dec 18, 2018

I've decided to give this a try [1].
The ConfigurationService implementation determines if the configuration area is available by looking for a kura.config.dirty property which it sets through the ConfigurationAdmin.
If the configuration area is clean it will load the configuration from the snapshot file.

To experiment with this branch, the osgi.clean property must be set to false. Alternatively, the directory specifying the configuration are must be deleted before Kura is started.

I've noticed a weird behavior in the emulator. Some components are weirdly activated, updated or deactivated (concurrently?) at a very early stage:

2018-12-18T14:29:31,930 [Start Level: Equinox Container: c582d4c8-4595-4678-8db9-dece1d090c20] INFO  o.e.k.c.d.H2DbServiceImpl - activating...
2018-12-18T14:29:31,931 [Start Level: Equinox Container: c582d4c8-4595-4678-8db9-dece1d090c20] INFO  o.e.k.c.d.H2DbServiceImpl - activating...done
2018-12-18T14:29:31,931 [pool-4-thread-1] INFO  o.e.k.c.d.H2DbServiceImpl - updating...
2018-12-18T14:29:31,932 [Start Level: Equinox Container: c582d4c8-4595-4678-8db9-dece1d090c20] INFO  o.e.k.c.d.H2DbServiceImpl - deactivate...
2018-12-18T14:29:32,081 [pool-4-thread-1] INFO  o.e.k.c.d.H2DbServiceImpl - Opening database with url: jdbc:h2:mem:kuradb
2018-12-18T14:29:32,173 [pool-4-thread-1] INFO  o.e.k.c.d.H2DbServiceImpl - updating...done
2018-12-18T14:29:32,173 [Start Level: Equinox Container: c582d4c8-4595-4678-8db9-dece1d090c20] INFO  o.e.k.c.d.H2DbServiceImpl - deactivate...done

I've not yet understood how to get the Felix SCR logs...

[1] https://github.com/cdealti/kura/tree/configuration-area-persisted

@MMaiero
Copy link
Contributor

MMaiero commented Dec 19, 2018

Worked a little bit more on this and came up with this branch: https://github.com/eclipse/kura/tree/configService_osgi-clean-false
It seems to be working, but needs more testing

Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the Stale label Nov 12, 2023
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants