You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/13 20:25:47 UTC

[lucene-solr] branch reference_impl updated: #119 - Harden jetty start for non cloud.

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/reference_impl by this push:
     new 8ad7bc7  #119 - Harden jetty start for non cloud.
8ad7bc7 is described below

commit 8ad7bc7b97babeb68ac519ed427c5f3bba33d76f
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Mon Jul 13 15:25:31 2020 -0500

    #119 - Harden jetty start for non cloud.
---
 .../org/apache/solr/client/solrj/embedded/JettySolrRunner.java     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java
index a73bb32..71b4ccd 100644
--- a/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java
+++ b/solr/core/src/java/org/apache/solr/client/solrj/embedded/JettySolrRunner.java
@@ -127,6 +127,8 @@ public class JettySolrRunner implements Closeable {
   volatile FilterHolder debugFilter;
   volatile FilterHolder qosFilter;
 
+  private final CountDownLatch startLatch = new CountDownLatch(1);
+
   private int jettyPort = -1;
 
   private final JettyConfig config;
@@ -446,6 +448,7 @@ public class JettySolrRunner implements Closeable {
         root.addFilter(dispatchFilter, "*", EnumSet.of(DispatcherType.REQUEST));
 
         log.info("Jetty loaded and ready to go");
+        startLatch.countDown();
 
       }
 
@@ -563,6 +566,10 @@ public class JettySolrRunner implements Closeable {
         } else {
           server.start();
         }
+        boolean success = startLatch.await(5, TimeUnit.SECONDS);
+        if (!success) {
+          throw new RuntimeException("Timeout waiting for Jetty to start");
+        }
       }
 
       if (getCoreContainer() != null) {