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 2011/03/25 00:00:05 UTC
[jira] [Created] (FELIX-2890) FileInstall starts non-daemon threads
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: Sahoo
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.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (FELIX-2890) FileInstall starts non-daemon
threads
Posted by "Guillaume Nodet (Resolved) (JIRA)" <ji...@apache.org>.
[ 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
[jira] [Commented] (FELIX-2890) FileInstall starts non-daemon
threads
Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/FELIX-2890?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045300#comment-13045300 ]
Guillaume Nodet commented on FELIX-2890:
----------------------------------------
It makes sense to me to configure threads as daemons.
> 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: Sahoo
>
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira