lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Dana (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (SOLR-1873) Commit Solr Cloud to trunk
Date Tue, 12 Oct 2010 01:55:42 GMT

    [ https://issues.apache.org/jira/browse/SOLR-1873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12920055#action_12920055
] 

Kevin Dana edited comment on SOLR-1873 at 10/11/10 9:55 PM:
------------------------------------------------------------

In ZkStateReader, the Threads created by updateCloudExecutor are preventing a clean shutdown
under Tomcat.
To correct this, the following code changes the declaration of updateCloudExecutor to use
a ThreadFactory to set the Threads to "daemon":
<pre>
  private static class ZKTF implements ThreadFactory {
    private static ThreadGroup tg = new ThreadGroup("ZkStateReader");
    @Override
    public Thread newThread(Runnable r) {
      Thread td = new Thread(tg, r);
      td.setDaemon(true);
      return td;
    }
  }
  private ScheduledExecutorService updateCloudExecutor = Executors.newScheduledThreadPool(1,
new ZKTF());
</pre>

      was (Author: kdana):
    In ZkStateReader, the Threads created by updateCloudExecutor are preventing a clean shutdown
under Tomcat.
To correct this, the following code changes the declaration of updateCloudExecutor to use
a ThreadFactory to set the Threads to "daemon":

  private static class ZKTF implements ThreadFactory {
    private static ThreadGroup tg = new ThreadGroup("ZkStateReader");
    @Override
    public Thread newThread(Runnable r) {
      Thread td = new Thread(tg, r);
      td.setDaemon(true);
      return td;
    }
  }
  private ScheduledExecutorService updateCloudExecutor = Executors.newScheduledThreadPool(1,
new ZKTF());

  
> Commit Solr Cloud to trunk
> --------------------------
>
>                 Key: SOLR-1873
>                 URL: https://issues.apache.org/jira/browse/SOLR-1873
>             Project: Solr
>          Issue Type: New Feature
>    Affects Versions: 1.4
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>             Fix For: Next
>
>         Attachments: log4j-over-slf4j-1.5.5.jar, SOLR-1873.patch, SOLR-1873.patch, SOLR-1873.patch,
SOLR-1873.patch, SOLR-1873.patch, SOLR-1873.patch, SOLR-1873.patch, SOLR-1873.patch, SOLR-1873.patch,
SOLR-1873.patch, SOLR-1873.patch, SOLR-1873.patch, TEST-org.apache.solr.cloud.ZkSolrClientTest.txt,
zookeeper-3.2.2.jar, zookeeper-3.3.1.jar
>
>
> This is a real hassle - I didn't merge up to trunk before all the svn scrambling, so
integrating cloud is now a bit difficult. I'm running through and just preparing a commit
by hand though (applying changes/handling conflicts a file at a time).

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message