[ 
https://issues.apache.org/jira/browse/FELIX-2890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guillaume Nodet resolved FELIX-2890.
------------------------------------

       Resolution: Fixed
    Fix Version/s: fileinstall-3.1.12
         Assignee: Guillaume Nodet  (was: Sahoo)
    
> FileInstall starts non-daemon threads
> -------------------------------------
>
>                 Key: FELIX-2890
>                 URL: https://issues.apache.org/jira/browse/FELIX-2890
>             Project: Felix
>          Issue Type: Bug
>          Components: File Install
>    Affects Versions: fileinstall-3.1.10
>            Reporter: Sahoo
>            Assignee: Guillaume Nodet
>             Fix For: fileinstall-3.1.12
>
>
> The initial fileinstall thread can be a non-daemon thread as shown below:
> "fileinstall-/space/ss141213/WS/gf/v3/publish/glassfish3/glassfish/modules/autostart/"
>  prio=10 tid=0x7b73d000 nid=0x1d77 in Object.wait() [0x7925c000]
> "fileinstall-/space/ss141213/WS/gf/v3/publish/glassfish3/glassfish/domains/domain1/autodeploy/bundles/"
>  daemon prio=10 tid=0x0a3d7c00 nid=0x1d76 in Object.wait() [0x792ad000]
> The first one here is created based on bundle context property where as the 
> second one is on config event. Looking at the code, I see the code does not 
> explicitly set daemon status, so the new thread just inherits the parent's 
> daemon status. A simple fix like the below is needed to make sure that 
> fileinstall always starts daemon thread so that even if the bundle is not 
> stopped, the VM exits. 
> Index: src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java
> ===================================================================
> --- src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java      
> (revision 1063634)
> +++ src/main/java/org/apache/felix/fileinstall/internal/FileInstall.java      
> (working copy)
> @@ -214,6 +214,7 @@
>              watcher.close();
>          }
>          watcher = new DirectoryWatcher(properties, context);
> +        watcher.setDaemon(true);
>          synchronized (watchers)
>          {
>              watchers.put(pid, watcher);
> Let me know if you have objections or you think it is an incompatible change.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to