You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by GitBox <gi...@apache.org> on 2022/02/09 10:56:19 UTC

[GitHub] [karaf] grgrzybek opened a new pull request #1489: [KARAF-7389] Prevent two threads (feature installer, CM Event Dispatc…

grgrzybek opened a new pull request #1489:
URL: https://github.com/apache/karaf/pull/1489


   …her through fileinstall) writing the same config file.
   
   This works for my case, however it's very hard to provide unit test for this.
   
   1. CM update happens without `felix.fileinstall.filename`, so FileInstall won't try to read and write the file in CM_UPDATED listener when `org.osgi.service.cm.Configuration#update()` is called
   2. `updateStorage()` is called with tmp file, highly minimizing the risk that FileInstall's `org.apache.felix.fileinstall.internal.DirectoryWatcher#install()` will be called with empty (or partial) file


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [karaf] jbonofre merged pull request #1489: [KARAF-7389] Prevent two threads (feature installer, CM Event Dispatc…

Posted by GitBox <gi...@apache.org>.
jbonofre merged pull request #1489:
URL: https://github.com/apache/karaf/pull/1489


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [karaf] jbonofre merged pull request #1489: [KARAF-7389] Prevent two threads (feature installer, CM Event Dispatc…

Posted by GitBox <gi...@apache.org>.
jbonofre merged pull request #1489:
URL: https://github.com/apache/karaf/pull/1489


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [karaf] jbonofre commented on a change in pull request #1489: [KARAF-7389] Prevent two threads (feature installer, CM Event Dispatc…

Posted by GitBox <gi...@apache.org>.
jbonofre commented on a change in pull request #1489:
URL: https://github.com/apache/karaf/pull/1489#discussion_r802589768



##########
File path: features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
##########
@@ -137,10 +137,10 @@ public void installFeatureConfigs(Feature feature) throws IOException, InvalidSy
                     cfg = createConfiguration(configAdmin, cid);
                     cfgProps.put(CONFIG_KEY, cid.pid);
                     properties.put(CONFIG_KEY, cid.pid);
+                    cfg.update(cfgProps);

Review comment:
       Don't we want to keep the update there ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [karaf] grgrzybek commented on a change in pull request #1489: [KARAF-7389] Prevent two threads (feature installer, CM Event Dispatc…

Posted by GitBox <gi...@apache.org>.
grgrzybek commented on a change in pull request #1489:
URL: https://github.com/apache/karaf/pull/1489#discussion_r802607889



##########
File path: features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java
##########
@@ -137,10 +137,10 @@ public void installFeatureConfigs(Feature feature) throws IOException, InvalidSy
                     cfg = createConfiguration(configAdmin, cid);
                     cfgProps.put(CONFIG_KEY, cid.pid);
                     properties.put(CONFIG_KEY, cid.pid);
+                    cfg.update(cfgProps);

Review comment:
       I moved the update up, so it's updated _without_ `felix.fileinstall.filename` property at this stage - this ensures that fileinstall (handling `CM_UPDATED`) won't read+write the file being written at the same time with `updateStorage()`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org