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/12/16 17:09:31 UTC

[lucene-solr] 01/02: @1242 Better stop wait.

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

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

commit e31ec33c19ac6fc14f9aca1d9ab1a63977949e7c
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Wed Dec 16 08:02:47 2020 -0600

    @1242 Better stop wait.
---
 solr/bin/solr                                             | 8 +++++---
 solr/core/src/java/org/apache/solr/servlet/StopJetty.java | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/solr/bin/solr b/solr/bin/solr
index 198dea4..84f670e 100755
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -841,12 +841,11 @@ function stop_solr() {
 
   JETTY_RUN="$SOLR_PID_DIR"
   JETTY_PID="solr-$SOLR_PORT.pid"
-  rm $SOLR_PID_DIR/$JETTY_PID
 
   echo -e "Sending stop command to Solr running on port $SOLR_PORT ...  "$JAVA" -cp $SOLR_TIP/server/lib/ext/solr-core*.jar $SOLR_SSL_OPTS $AUTHC_OPTS org.apache.solr.servlet.StopJetty "-DSTOP.PORT=$THIS_STOP_PORT" "-DSTOP.KEY=$STOP_KEY""
   "$JAVA" -cp $SOLR_TIP/server/lib/ext/solr-core*.jar $SOLR_SSL_OPTS $AUTHC_OPTS "-DSTOP.PORT=$THIS_STOP_PORT" "-DSTOP.KEY=$STOP_KEY" org.apache.solr.servlet.StopJetty || true
-  sleep .3
-
+  PID=$(cat $SOLR_PID_DIR/$JETTY_PID)
+  rm $SOLR_PID_DIR/$JETTY_PID
 } # end stop_solr
 
 if [ $# -eq 1 ]; then
@@ -2180,6 +2179,9 @@ function start_solr() {
 
 }
 
+find "$SOLR_SERVER_DIR/lib" -type f -exec cat {} > /dev/null \;
+find "$SOLR_SERVER_DIR/lib/ext" -type f -exec cat {} > /dev/null \;
+
 start_solr "$FG" "$ADDITIONAL_CMD_OPTS" "$ADDITIONAL_JETTY_CONFIG"
 
 exit $?
\ No newline at end of file
diff --git a/solr/core/src/java/org/apache/solr/servlet/StopJetty.java b/solr/core/src/java/org/apache/solr/servlet/StopJetty.java
index 83e324b..869e771 100644
--- a/solr/core/src/java/org/apache/solr/servlet/StopJetty.java
+++ b/solr/core/src/java/org/apache/solr/servlet/StopJetty.java
@@ -18,7 +18,7 @@ public class StopJetty {
   public static void main(String[] args) {
     int port = Integer.getInteger("STOP.PORT",-1);
     String key = System.getProperty("STOP.KEY",null);
-    int timeout =  Integer.getInteger("STOP.WAIT",0);
+    int timeout =  Integer.getInteger("STOP.WAIT",30);
     stop(port,key,timeout);
   }