You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Sahoo (JIRA)" <ji...@apache.org> on 2009/04/11 17:59:14 UTC

[jira] Created: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

FileInstaller spawns multiple watchers for same directory
---------------------------------------------------------

                 Key: FELIX-1036
                 URL: https://issues.apache.org/jira/browse/FELIX-1036
             Project: Felix
          Issue Type: Bug
         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
            Reporter: Sahoo


I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:

"{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)

"{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)

"{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)

"{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)

"{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)


The funny thing is the number keeps increasing by one more for every subsequent restart.

I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.

It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by Sahoo <Sa...@Sun.COM>.
Filippo Diotalevi wrote:
> On Thu, Apr 16, 2009 at 4:12 PM, Sahoo (JIRA) <ji...@apache.org> wrote:
>   
>> Filippo,
>>
>> I tried the patch. It works as I see only one watcher per every watched directory, but for some reason, I see configuration values getting printed twice for the second directory as shown below:
>>
>> felix.fileinstall.poll  (ms)   5000
>> felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/modules
>> felix.fileinstall.debug          1
>> felix.fileinstall.bundles.new.start          false
>> felix.fileinstall.poll  (ms)   5000
>> felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/domains/domain1/autodeploy-modules
>> felix.fileinstall.debug          1
>> felix.fileinstall.bundles.new.start          true
>> Updating configuration from org.apache.felix.fileinstall-autodeploy-modules.cfg
>> felix.fileinstall.poll  (ms)   5000
>> felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/domains/domain1/autodeploy-modules
>> felix.fileinstall.debug          1
>> felix.fileinstall.bundles.new.start          true
>>
>>     
>
> I think that it is correct.
>
> The first log is a fileinstall created with config.properties, I guess.
>
> The second log is caused by cached configuration dictionary.
>
> The third log is caused by fileinstall finding a configuration file.
> It correctly determines that it's a configuration already existent (in
> fact you see the new log "Updating configuration"; so it retrieves the
> old configuration and .update() it.
>
>
>   
Looks like I missed the line "Updating configuration from 
org.apache.felix.fileinstall-autodeploy-modules.cfg." I will update the 
bug. The patch works for me.

Thanks,
Sahoo

Re: [jira] Commented: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by Filippo Diotalevi <fi...@gmail.com>.
On Thu, Apr 16, 2009 at 4:12 PM, Sahoo (JIRA) <ji...@apache.org> wrote:
> Filippo,
>
> I tried the patch. It works as I see only one watcher per every watched directory, but for some reason, I see configuration values getting printed twice for the second directory as shown below:
>
> felix.fileinstall.poll  (ms)   5000
> felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/modules
> felix.fileinstall.debug          1
> felix.fileinstall.bundles.new.start          false
> felix.fileinstall.poll  (ms)   5000
> felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/domains/domain1/autodeploy-modules
> felix.fileinstall.debug          1
> felix.fileinstall.bundles.new.start          true
> Updating configuration from org.apache.felix.fileinstall-autodeploy-modules.cfg
> felix.fileinstall.poll  (ms)   5000
> felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/domains/domain1/autodeploy-modules
> felix.fileinstall.debug          1
> felix.fileinstall.bundles.new.start          true
>

I think that it is correct.

The first log is a fileinstall created with config.properties, I guess.

The second log is caused by cached configuration dictionary.

The third log is caused by fileinstall finding a configuration file.
It correctly determines that it's a configuration already existent (in
fact you see the new log "Updating configuration"; so it retrieves the
old configuration and .update() it.


-- 
Filippo Diotalevi

Re: [jira] Updated: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by Filippo Diotalevi <fi...@gmail.com>.
On Thu, Apr 16, 2009 at 10:13 AM, Filippo Diotalevi (JIRA)
<ji...@apache.org> wrote:
>
>     [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>    Attachment: FELIX-1036.patch
>
> Sahoo, can you give this patch a run? I tried againt you use case and in my application, and it seems to work.
> [...]
> The patch assumes that configuration files always "win". In other words, at startup, all cached configurations are updated with
> dictionaries coming from configuration files.
> I think it's acceptable, since when you use FileInstall you are not supposed to change the configurations using other tools like
> WebConsole.

Just an additional note on this bug.

In my OSGi applications (all server side) I never felt the need for a
bundle cache, so I always delete it before restarts and never
experienced similar problems.

However, while debugging fileinstall I realized that there's at least
one more issue when using bundle cache and the fileinstall approach.
If you
- have your application running with a set of configuration files
managed by FileInstall
- stop the application
- remove one configuration file
- restart the application *and your application use the felix-cache*
then the deleted configuration dictionary will be still present,
because it's retrieved from cache and never deleted.

Honestly for me it's a non-issue. Caching and FileInstall are kind of
opposite approaches, either you store your configuration files in the
cache, or in the FileInstall. However I see that it can be seen as a
strange behavior.

I'm wondering how (and if) other fileinstaller/dirpoller, like the
servicemix one, solve this problem.

-- 
Filippo Diotalevi

[jira] Assigned: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier reassigned FELIX-1036:
----------------------------------------

    Assignee: Clement Escoffier

> FileInstaller spawns multiple watchers for same directory
> ---------------------------------------------------------
>
>                 Key: FELIX-1036
>                 URL: https://issues.apache.org/jira/browse/FELIX-1036
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-0.9.2
>         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
>            Reporter: Sahoo
>            Assignee: Clement Escoffier
>         Attachments: FELIX-1036.patch
>
>
> I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:
> "{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> The funny thing is the number keeps increasing by one more for every subsequent restart.
> I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.
> It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier resolved FELIX-1036.
--------------------------------------

       Resolution: Fixed
    Fix Version/s:  fileinstall-1.0.0

I committed the patch. Please close the issue if it's ok for you.

> FileInstaller spawns multiple watchers for same directory
> ---------------------------------------------------------
>
>                 Key: FELIX-1036
>                 URL: https://issues.apache.org/jira/browse/FELIX-1036
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-0.9.2
>         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
>            Reporter: Sahoo
>            Assignee: Clement Escoffier
>             Fix For:  fileinstall-1.0.0
>
>         Attachments: FELIX-1036.patch
>
>
> I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:
> "{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> The funny thing is the number keeps increasing by one more for every subsequent restart.
> I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.
> It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by "Filippo Diotalevi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Filippo Diotalevi updated FELIX-1036:
-------------------------------------

    Attachment: FELIX-1036.patch

Sahoo, can you give this patch a run? I tried againt you use case and in my application, and it seems to work.

First of all I removed the configuration map and ConfigurationKey object.

Second, every time a property file is detected, I (transparently to the user) add a property "felix.fileinstall.filename" with the name of the file as value to the dictionary. In this way the configuration dictionary always contains the filename, and we can just use Configuration Admin service to check if a configuration file has been read and processed.

Finally, when the DirectoryWatcher finds an updated file (or, after Felix startup, simply finds any file) it uses the Configuration Admin service to check if a configuration exist with felix.fileinstall.filename=<filename>
If it already exists, it updates the configuration using the dictionary provided by the configuration file.

The patch assumes that configuration files always "win". In other words, at startup, all cached configurations are updated with dictionaries coming from configuration files.
I think it's acceptable, since when you use FileInstall you are not supposed to change the configurations using other tools like WebConsole.

> FileInstaller spawns multiple watchers for same directory
> ---------------------------------------------------------
>
>                 Key: FELIX-1036
>                 URL: https://issues.apache.org/jira/browse/FELIX-1036
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-0.9.2
>         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
>            Reporter: Sahoo
>         Attachments: FELIX-1036.patch
>
>
> I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:
> "{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> The funny thing is the number keeps increasing by one more for every subsequent restart.
> I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.
> It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by "Filippo Diotalevi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699129#action_12699129 ] 

Filippo Diotalevi commented on FELIX-1036:
------------------------------------------

Replicated with Felix 1.4.1. I didn't notice it before because I always delete felix cache before starting.

It's quite tricky. FileInstall (a ManagedServiceFactory) is notified twice (or more times ): the first time the configuration contained in the cache is passed, the second the configuration as read in the configuration file.
Trying to work on a patch now.

> FileInstaller spawns multiple watchers for same directory
> ---------------------------------------------------------
>
>                 Key: FELIX-1036
>                 URL: https://issues.apache.org/jira/browse/FELIX-1036
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-0.9.2
>         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
>            Reporter: Sahoo
>
> I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:
> "{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> The funny thing is the number keeps increasing by one more for every subsequent restart.
> I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.
> It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by "Sahoo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sahoo closed FELIX-1036.
------------------------


Issue resolved.

> FileInstaller spawns multiple watchers for same directory
> ---------------------------------------------------------
>
>                 Key: FELIX-1036
>                 URL: https://issues.apache.org/jira/browse/FELIX-1036
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-0.9.2
>         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
>            Reporter: Sahoo
>            Assignee: Clement Escoffier
>             Fix For:  fileinstall-1.0.0
>
>         Attachments: FELIX-1036.patch
>
>
> I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:
> "{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> The funny thing is the number keeps increasing by one more for every subsequent restart.
> I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.
> It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by "Sahoo (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sahoo updated FELIX-1036:
-------------------------

          Component/s: File Install
    Affects Version/s: fileinstall-0.9.2

> FileInstaller spawns multiple watchers for same directory
> ---------------------------------------------------------
>
>                 Key: FELIX-1036
>                 URL: https://issues.apache.org/jira/browse/FELIX-1036
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-0.9.2
>         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
>            Reporter: Sahoo
>
> I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:
> "{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> The funny thing is the number keeps increasing by one more for every subsequent restart.
> I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.
> It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by "Sahoo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699713#action_12699713 ] 

Sahoo commented on FELIX-1036:
------------------------------

Filippo,

I tried the patch. It works as I see only one watcher per every watched directory, but for some reason, I see configuration values getting printed twice for the second directory as shown below:

felix.fileinstall.poll  (ms)   5000
felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/modules
felix.fileinstall.debug          1
felix.fileinstall.bundles.new.start          false
felix.fileinstall.poll  (ms)   5000
felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/domains/domain1/autodeploy-modules
felix.fileinstall.debug          1
felix.fileinstall.bundles.new.start          true
Updating configuration from org.apache.felix.fileinstall-autodeploy-modules.cfg
felix.fileinstall.poll  (ms)   5000
felix.fileinstall.dir            /space/ss141213/WS/gf/v3.trunk.new/publish/glassfish/domains/domain1/autodeploy-modules
felix.fileinstall.debug          1
felix.fileinstall.bundles.new.start          true

Pl. also note that, it does not always happen. So, I think there is some timing issue here.

> FileInstaller spawns multiple watchers for same directory
> ---------------------------------------------------------
>
>                 Key: FELIX-1036
>                 URL: https://issues.apache.org/jira/browse/FELIX-1036
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-0.9.2
>         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
>            Reporter: Sahoo
>         Attachments: FELIX-1036.patch
>
>
> I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:
> "{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> The funny thing is the number keeps increasing by one more for every subsequent restart.
> I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.
> It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-1036) FileInstaller spawns multiple watchers for same directory

Posted by "Sahoo (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699726#action_12699726 ] 

Sahoo commented on FELIX-1036:
------------------------------

Looks like I missed the line "Updating configuration from org.apache.felix.fileinstall-autodeploy-modules.cfg." So the second output is expected. So, the patch works for me. 


> FileInstaller spawns multiple watchers for same directory
> ---------------------------------------------------------
>
>                 Key: FELIX-1036
>                 URL: https://issues.apache.org/jira/browse/FELIX-1036
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-0.9.2
>         Environment: Felix 1.6.0, fileinstall 0.9.2, configadmin 1.0.10
>            Reporter: Sahoo
>         Attachments: FELIX-1036.patch
>
>
> I am running into a strange issue and I don't know if it has to do with any bad use in my part. I am using fileinstall to monitor two directories. fileinstall is configured using config.properties file to monitor a dir called /space/ss141213/software/felix-1.6.0/bundle. I have a cfg file in modules dir that configures fileinstall to monitor a second dir called /tmp/bundles. During subsequent start of the framework, I see fileinstall spwaning more than one watchers for the second dir as shown in the jstack output below:
> "{felix.fileinstall.dir=/space/ss141213/software/felix-1.6.0/bundle, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0833fc00 nid=0xd waiting on condition [0xcbaea000..0xcbaeaae0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.bd775a2e-9ed9-41e4-8159-83295f3aaefa, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x083a5800 nid=0x13 waiting on condition [0xcb7ad000..0xcb7adbe0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.2aac2209-96d0-4dcb-8e33-ac3f6fbf2856, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x08387800 nid=0x12 waiting on condition [0xcb927000..0xcb927a60]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.8997ded4-b1de-46bb-b675-4166734eea73, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838a000 nid=0x11 waiting on condition [0xcb979000..0xcb9798e0]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> "{service.pid=org.apache.felix.fileinstall.15c95057-a0f9-4269-b827-44df4fa23f6b, felix.fileinstall.dir=/tmp/bundles, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" daemon prio=3 tid=0x0838c800 nid=0x10 waiting on condition [0xcb9cb000..0xcb9cb960]
>    java.lang.Thread.State: TIMED_WAITING (sleeping)
>         at java.lang.Thread.sleep(Native Method)
>         at org.apache.felix.fileinstall.DirectoryWatcher.run(DirectoryWatcher.java:122)
> The funny thing is the number keeps increasing by one more for every subsequent restart.
> I see that as part of initial configuration, fileinstall spwans a directory watcher for modules dir, as this is configured using config.properties. Then that directorywatcher spawns a second one after it discovers the cfg file in modules dir. At the same time, configuration manager also notifies fileinstaller based on what appears to be its cached values.
> It is very easy to reproduce. In a standard felix installation, drop fileinstall bundle alonng with configurationmanager bundle into bundle dir. Add it to the auto.start list. Add a cfg file with an entry: felix.fileinstall.dir=/tmp/bundles. Now start Felix. This time you shall see only thread for /tmp/bundles. Restart Felix, now you shall see two threads for that dir. Restart again to see three threads and it continues. If you clean the cache, it goes back to one thread.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.