Issue with OSGi Config Admin, DS and component factory [message #1821647] |
Tue, 18 February 2020 02:53  |
Eclipse User |
|
|
|
Hi,
I encountered a problem with a factory component, Equinox CM ( 1.4.200.v20191001-1333) and a custom bundle with the following service component:
@Component(name = "ConfiguredComponent", service = {}, configurationPid = { "$", "mybase" },
configurationPolicy = ConfigurationPolicy.REQUIRE)
public class ConfiguredComponent {}
If I provide 2 factory configurations via the ConfigAdmin and a configuration with the name "mybase" two instances of ConfiguredComponent are created. That works fine just as expected.
However if I stop and start the bundle containing the ConfiguredComponent, both instances are not re-created though all respective configurations are still active.
I found out that having "mybase" as additional configurationPid is responsible for the unexpected behaviour. If I remove the configurationPid definition from the component header restarting the bundle will also restart the two component instances as I would have expected.
Is this a cm bug with handling multiple configurations? Or is a factory component only allowed to have one configuration which will control the instance creation?
Thank in advance,
Mike
PS: If needed I could provide a complete example demonstrating the issue.
|
|
|
|
|
Re: Issue with OSGi Config Admin, DS and component factory [message #1821748 is a reply to message #1821727] |
Wed, 19 February 2020 08:30  |
Eclipse User |
|
|
|
Right, I had to refresh my memory on how this works. So SCR (DS implementation) is supposed to merge the mybase config properties with the factory configuration from "$" which should result in two instances of your service component. It seems this is happening initially which indicates that SCR is receiving the configuration events correctly from config admin and applying them to the component instances. My guess is that SCR has some bug when a bundle is restarted and it needs to do this merge operation from a cached configuration state. If you open a bug with steps to reproduce we can have a look. If it is a Felix SCR issue then we can get an issue open with Felix once that is determined.
|
|
|
Powered by
FUDForum. Page generated in 0.44594 seconds