murblanc commented on a change in pull request #1831:
URL: https://github.com/apache/lucene-solr/pull/1831#discussion_r483581489



##########
File path: solr/core/src/java/org/apache/solr/cloud/Overseer.java
##########
@@ -775,6 +779,42 @@ private void doCompatCheck(BiConsumer<String, Object> 
consumer) {
     }
   }
 
+  /**
+   * Start {@link ClusterSingleton} plugins when we become the leader.
+   */
+  private void startClusterSingletons() {
+    PluginBag<SolrRequestHandler> handlers = 
getCoreContainer().getRequestHandlers();
+    if (handlers == null) {
+      return;
+    }
+    handlers.keySet().forEach(handlerName -> {
+      SolrRequestHandler handler = handlers.get(handlerName);
+      if (handler instanceof ClusterSingleton) {
+        try {
+          ((ClusterSingleton) handler).start();
+        } catch (Exception e) {
+          log.warn("Exception starting ClusterSingleton " + handler, e);
+        }
+      }
+    });
+  }
+
+  /**
+   * Stop {@link ClusterSingleton} plugins when we lose leadership.
+   */
+  private void stopClusterSingletons() {
+    PluginBag<SolrRequestHandler> handlers = 
getCoreContainer().getRequestHandlers();

Review comment:
       Should we stop currently configured `ClusterSingleton` handlers or 
rather stop all those we've started? Is the configuration immutable?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to