You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2023/09/05 10:15:32 UTC

[solr] branch main updated: SOLR-16956: fix not being able to stop a solr by port number (#1880)

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

epugh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/main by this push:
     new 0eef652827f SOLR-16956: fix not being able to stop a solr by port number (#1880)
0eef652827f is described below

commit 0eef652827fb4bd2cf8b61b8a0eb4f388f201b7c
Author: Eric Pugh <ep...@opensourceconnections.com>
AuthorDate: Tue Sep 5 06:15:26 2023 -0400

    SOLR-16956: fix not being able to stop a solr by port number (#1880)
---
 solr/bin/solr                            |  1 +
 solr/packaging/test/test_start_solr.bats | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/solr/bin/solr b/solr/bin/solr
index 8a6d0560757..e11eec4e8d4 100644
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -1301,6 +1301,7 @@ if [ $# -gt 0 ]; then
               exit 1
             fi
             SOLR_PORT="$2"
+            PROVIDED_SOLR_PORT="${SOLR_PORT}"
             PASS_TO_RUN_EXAMPLE+=("-p" "$SOLR_PORT")
             shift 2
         ;;
diff --git a/solr/packaging/test/test_start_solr.bats b/solr/packaging/test/test_start_solr.bats
index e0d7e5d981e..3b664759da4 100644
--- a/solr/packaging/test/test_start_solr.bats
+++ b/solr/packaging/test/test_start_solr.bats
@@ -36,3 +36,16 @@ teardown() {
   run bash -c 'solr stop -all 2>&1'
   refute_output --partial 'forcefully killing'
 }
+
+@test "stop command for single port" {
+
+  solr start
+  solr start -p 7574
+  solr assert --started http://localhost:8983/solr --timeout 5000
+  solr assert --started http://localhost:7574/solr --timeout 5000
+  
+  run solr stop -p 7574
+  solr assert --not-started http://localhost:7574/solr --timeout 5000
+  solr assert --started http://localhost:8983/solr --timeout 5000
+
+}