You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shindig.apache.org by "Paul Lindner (JIRA)" <ji...@apache.org> on 2009/09/03 19:28:57 UTC
[jira] Resolved: (SHINDIG-1164) Shindig default Executor can block
shutdown
[ https://issues.apache.org/jira/browse/SHINDIG-1164?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Lindner resolved SHINDIG-1164.
-----------------------------------
Resolution: Fixed
applied.
> Shindig default Executor can block shutdown
> -------------------------------------------
>
> Key: SHINDIG-1164
> URL: https://issues.apache.org/jira/browse/SHINDIG-1164
> Project: Shindig
> Issue Type: Improvement
> Components: Java
> Affects Versions: 1.1-BETA2
> Reporter: Paul Lindner
> Assignee: Paul Lindner
> Fix For: 1.1-BETA3
>
> Attachments: tf.diff
>
>
> The default executor service used by shindig is created like this:
> Executors.newCachedThreadPool()
> This call uses a thread factory that uses non-daemon threads. Under certain circumstances the fetching code (and who knows what else) will have blocked threads that keep this pool from shutting down cleanly.
> I'd like to use a Thread Factory that uses daemon threads to insure that this is not an issue.
> Something like this:
> public static ThreadFactory daemonThreadFactory() {
> final ThreadFactory f = Executors.defaultThreadFactory();
> return new ThreadFactory() {
> public Thread newThread(Runnable r) {
> Thread t = f.newThread(r);
> t.setDaemon(true);
> return t;
> }
> };
> }
> Does everyone think that this is the right solution?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.