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

Hoss Man edited comment on SOLR-13310 at 3/9/19 12:07 AM:
----------------------------------------------------------

This was evidently introduced as part of [[email protected]]'s work in 
SOLR-12801 – I'm guessing because prior to this the executor wasn't being 
shutdown cleanly? ... but this still seems like a bug.

best case scenerio it's going to be confusing a hell for anyone looking at 
thread dumps, worst case scenerio this (may) actaully causes some bugs because 
of how the UpdateShardHandler is treated special in terms of error handling.

 
{noformat}
@@ -170,6 +166,7 @@ public class SimpleFacets {
     this.docsOrig = docs;
     this.global = params;
     this.rb = rb;
+    this.facetExecutor = 
req.getCore().getCoreContainer().getUpdateShardHandler().getUpdateExecutor();
   }
 
   public void setFacetDebugInfo(FacetDebugInfo fdebugParent) {
@@ -773,13 +770,7 @@ public class SimpleFacets {
     }
   };
 
-  static final Executor facetExecutor = new 
ExecutorUtil.MDCAwareThreadPoolExecutor(
-          0,
-          Integer.MAX_VALUE,
-          10, TimeUnit.SECONDS, // terminate idle threads after 10 sec
-          new SynchronousQueue<Runnable>()  // directly hand off tasks
-          , new DefaultSolrThreadFactory("facetExecutor")
-  );
+  private final Executor facetExecutor;
{noformat}

(EDIT: added "may" regarding the potential for bugs here ... i didn't mean to 
imply that i know for a fact it was causing bugs)


was (Author: hossman):
This was evidently introduced as part of [[email protected]]'s work in 
SOLR-12801 – I'm guessing because prior to this the executor wasn't being 
shutdown cleanly? ... but this still seems like a bug.

best case scenerio it's going to be confusing a hell for anyone looking at 
thread dumps, worst case scenerio this actaully causes some bugs because of how 
the UpdateShardHandler is treated special in terms of error handling.

 
{noformat}
@@ -170,6 +166,7 @@ public class SimpleFacets {
     this.docsOrig = docs;
     this.global = params;
     this.rb = rb;
+    this.facetExecutor = 
req.getCore().getCoreContainer().getUpdateShardHandler().getUpdateExecutor();
   }
 
   public void setFacetDebugInfo(FacetDebugInfo fdebugParent) {
@@ -773,13 +770,7 @@ public class SimpleFacets {
     }
   };
 
-  static final Executor facetExecutor = new 
ExecutorUtil.MDCAwareThreadPoolExecutor(
-          0,
-          Integer.MAX_VALUE,
-          10, TimeUnit.SECONDS, // terminate idle threads after 10 sec
-          new SynchronousQueue<Runnable>()  // directly hand off tasks
-          , new DefaultSolrThreadFactory("facetExecutor")
-  );
+  private final Executor facetExecutor;
{noformat}

> facet.threads is using the updateExecutor
> -----------------------------------------
>
>                 Key: SOLR-13310
>                 URL: https://issues.apache.org/jira/browse/SOLR-13310
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Hoss Man
>            Priority: Major
>
> Had a WTF moment skimming some SimpleFacets code today...
> {code}
>     this.facetExecutor = 
> req.getCore().getCoreContainer().getUpdateShardHandler().getUpdateExecutor();
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to