Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
cellar-3.0.0
-
None
Description
Let's suppose a cluster with two nodes: a producer and a consumer, both in default group.
From producer node cluster:config-propset command is executed to change a property value in org.apache.karaf.features PID.
Example:
$ cluster:config-propset default org.apache.karaf.features featuresBoot config,cellar
featuresBoot value is changed on both nodes, but is not updated on etc/org.apache.karaf.features.cfg file.
In karaf.log file a message like follows is written :
CELLAR CONFIG: retrieved event ClusterConfigurationEvent [type=0, id=org.apache.karaf.features, sourceNode=HazelcastNode [id=localhost:5701, host=localhost, port=5701], sourceGroup=org.apache.karaf.cellar.core.Group@5c13d641, destination=null, force=false, postPublish=false] while groupManager is not available yet
After debugging code I have found that groupManager attribute is not initialized in class org.apache.karaf.cellar.config.ConfigurationEventHandler
eventHandler bean definition in file config/src/main/resources/OSGI-INF/blueprint/blueprint.xml has no dependency injection for groupManager.
Comparing this definition with other branches looks like a regression, because on branch cellar-2.2.x or cellar-2.3.x this bean definition is
<!-- Cluster Event Handler --> <bean id="eventHandler" class="org.apache.karaf.cellar.config.ConfigurationEventHandler" init-method="init" destroy-method="destroy"> <property name="clusterManager" ref="clusterManager"/> <property name="groupManager" ref="groupManager"/> <property name="configurationAdmin" ref="configurationAdmin"/> <property name="storage" value="${storage}"/> </bean>
Injecting groupManager definition will solve the issue.