[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13939297#comment-13939297 ] Uwe Barthel commented on FELIX-4436: [~metatech] Have you had time for a test? In my test setup the patch works. {code} g! lb START LEVEL 1 ID|State |Level|Name 0|Active |0|System Bundle (4.2.1) 1|Active |1|HSQLDB (2.2.4) 2|Active |1|Apache Aries Blueprint Bundle (1.1.0) 3|Active |1|Apache Aries Proxy Bundle (1.0.0) 4|Active |1|Apache Aries Util (1.0.0) 5|Active |1|Apache Felix Bundle Repository (1.6.6) 6|Active |1|Apache Felix Configuration Admin Service (1.8.0) 7|Active |1|Apache Felix File Install (3.3.0.SNAPSHOT) 8|Active |1|Apache Felix Gogo Command (0.12.0) 9|Active |1|Apache Felix Gogo Runtime (0.10.0) 10|Active |1|Apache Felix Gogo Shell (0.10.0) 11|Active |1|Apache Karaf :: Deployer :: Blueprint (2.2.8) 12|Active |1|OPS4J Pax Logging - API (1.6.7) 13|Active |1|OPS4J Pax Logging - Service (1.6.7) 14|Active |1|datasource-hsqldb.xml (0.0.0) {code} > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13934910#comment-13934910 ] metatech commented on FELIX-4436: - [~barthel] Sorry, I do not use Github, so I downloaded the patch manually and only looked at the beginning and did not see the other changes. I will give it a try. > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13934813#comment-13934813 ] Uwe Barthel commented on FELIX-4436: [~metatech]: the patch (pull req. #4) contains the commits of #3 too and adds two new one. If it is the felix way, so may I provide a patch file instead of git pull requests? > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13934785#comment-13934785 ] metatech commented on FELIX-4436: - [~barthel] : your pull #4 is the same as #3 > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13934322#comment-13934322 ] ASF GitHub Bot commented on FELIX-4436: --- GitHub user barthel opened a pull request: https://github.com/apache/felix/pull/4 Possible fix for [FELIX-4436] https://issues.apache.org/jira/browse/FELIX-4436 * handle bundle if bundle location is a opaque uri * use 'file:' instead of last index of colon for extract the path name from opaque uri * test added You can merge this pull request into a Git repository by running: $ git pull https://github.com/barthel/felix trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/felix/pull/4.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #4 commit 008c1c43aca0b8d10f54f6eb1bf55854128e1614 Author: Uwe Barthel Date: 2014-03-05T06:34:52Z [FELIX-4436] handle bundle if bundle location is a opaque uri commit b623ec0a2a607c4f8baa827660ba32bfdfccf09d Author: Uwe Barthel Date: 2014-03-13T23:52:55Z [FELIX-4436] handle bundle if bundle location is a opaque uri * use 'file:' instead of last index of colon for extract the path name from opaque uri * test added > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13934319#comment-13934319 ] ASF GitHub Bot commented on FELIX-4436: --- Github user barthel closed the pull request at: https://github.com/apache/felix/pull/3 > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13934320#comment-13934320 ] Uwe Barthel commented on FELIX-4436: Hi metatech, Thx for review my patch. {quote} To be honest, I do not understand how your patch is supposed to solve the problem, could you please elaborate ? {quote} The idea behind my patch is to prevent to put the bundle into the {{installedBundles}} collection. This collection will be added into the {{toRefresh}} set, which you comment out in your patch. If you're going the way back, you'll find a long if-else statement. In this if-else statement, it's about if the file exists and whether an {{Artifact}} object exists. If this {{Artifact}} object is not found, it is newly created and inserted into the {{toRefresh}} set. A list of all known {{Artifact}} objects is collected at startup in the method {{#initializeCurrentManagedBundles()}}. Creating the {{Artifact}} object for the Blueprint XML file based on the path of the found file and the Bundle Location of the already known bundles. I hope this and my explanation above, have explained my thought better. {quote} Also, I notice that on Windows, the path extraction algorithm does not work, because there is an extra colon in the path, eg C:/ {quote} You're absolutely right. My solution is not optimal at this point. Perhaps it is better to search {{file:}}, instead of the last colon. This could be the reason why it does not work for you. I've change the implementation. Please try it again. Did you run the {{DirectoryWatcherTest}} test? Sincerely barthel > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13933306#comment-13933306 ] metatech commented on FELIX-4436: - Hi Uwe, Thanks for looking into this issue. I tried your patch but it does not change my observations : on every start-up, the Blueprint XML are still refreshed. To be honest, I do not understand how your patch is supposed to solve the problem, could you please elaborate ? Also, I notice that on Windows, the path extraction algorithm does not work, because there is an extra colon in the path, eg C:/ Regards, metatech > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13920581#comment-13920581 ] ASF GitHub Bot commented on FELIX-4436: --- GitHub user barthel opened a pull request: https://github.com/apache/felix/pull/3 [FELIX-4436] handle bundle if bundle location is a opaque uri You can merge this pull request into a Git repository by running: $ git pull https://github.com/barthel/felix trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/felix/pull/3.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3 commit 008c1c43aca0b8d10f54f6eb1bf55854128e1614 Author: Uwe Barthel Date: 2014-03-05T06:34:52Z [FELIX-4436] handle bundle if bundle location is a opaque uri > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (FELIX-4436) DirectoryWatcher should not "refresh" Blueprint XML deployments on every start-up
[ https://issues.apache.org/jira/browse/FELIX-4436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13919641#comment-13919641 ] Uwe Barthel commented on FELIX-4436: I think the provided patch does not solve the real problem. h4. Explanation of my understanding The blueprint deployer extending the {{ArtifactUrlTransformer}} and create a new bundle (JAR) based on passed blueprint XML file. This bundle goes the normal way and will be installed. The bundle location is a opaque URI like: {noformat} blueprint:file:/tmp/fileinstall/deploy/blueprint.xml {noformat} The real problem, as I understand it, is located deep in the {{#initializeCurrentManagedBundles()}} method. If the {{DirectoryWatcher}} starts to work, the {{#initializeCurrentManagedBundles()}} will be executed and analysed the installed artifacts: # get all installed bundles # interate over all bundles and get the bundle location # create normalized {{URI}} based on bundle location # check {{URI#getPath()}} ## if path is {{null}} or path doesn't starts with the configured watch directory *** continue *without* create {{Artifact}} object for the installed bundle/ ## otherwise *** create {{Artifact}} object and add to global {{currentManagedArtifacts}} via {{#setArtifact(...)}} After all the {{#process(...)}} method will be execute (this is the method where the provided patch is located). This method iterate also over the files and tried to get a {{Artifact}} object for the passed file. In the described case no {{Artifact}} object will be found for the blueprint XML file and the way goes to the {{// File has been added}}-_else_ part of the big _if-else_ statement. At this point a new {{Artifact}} object will be created and added to the {{created}}-List. The content of the {{created}}-List will be installed or updated via {{#install(...)}} and the returned {{Bundle}} objects goes directly into the {{toRefresh}}-Set. h4. Possible solution Try to handle opaque {{URI}}s at the point _4.1_. > DirectoryWatcher should not "refresh" Blueprint XML deployments on every > start-up > - > > Key: FELIX-4436 > URL: https://issues.apache.org/jira/browse/FELIX-4436 > Project: Felix > Issue Type: Bug > Components: File Install >Affects Versions: fileinstall-3.2.4 > Environment: ServiceMix 4.5.3 >Reporter: metatech >Priority: Minor > Attachments: felix_no_refresh_installed.patch > > > DirectoryWatcher can auto-deploy JAR or XML files placed in a directory. > Blueprint XML files (containing for instance ActiveMQ factories or JAAS > realms) are detected as "installed" on every start-up. Prior to FELIX-2066, > this had no effect. Since FELIX-2066, bundles detected as "installed" are > now forcibly "refreshed" on every start-up. The impact is that these bundles > are stopped and restarted during the container start-up. Because there are > some race conditions (see FELIX-3067), this can prevent those XML files or > other bundles depending on them from fully starting. Here is a patch which > avoids restarting those bundles when they were not modified. -- This message was sent by Atlassian JIRA (v6.2#6252)