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


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.

Reply via email to