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

joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 893c55b5239d7b6e7bda0499fbbe9ba0547561a6
Author: Joe McDonnell <[email protected]>
AuthorDate: Fri Jun 9 10:24:03 2023 -0700

    IMPALA-12198: Create $RANGER_LOG_DIR before stopping in 
kill-ranger-server.sh
    
    If the $RANGER_LOG_DIR directory doesn't exist, then Ranger's
    ranger-admin-services.sh will fail to issue the stop command
    because it tries and fails to write to that directory. Ranger's
    script believes that it has issued the stop to Ranger, so it
    waits for 30 seconds for Ranger to stop. When Ranger doesn't stop,
    it kills Ranger. This is an unnecessary delay in stopping Ranger.
    It is common if a developer runs bin/clean.sh after starting
    Ranger.
    
    This modifies kill-ranger-server.sh to create $RANGER_LOG_DIR
    before running ranger-admin-services.sh with the stop command.
    Since the directory exists, the stop command is successfully
    issued and the script won't wait 30 seconds.
    
    Testing:
     - Hand testing with starting Ranger, then running bin/clean.sh,
       then running kill-ranger-server.sh
    
    Change-Id: I6ba5a90172affde3949e9f9a7618bde0dfa8c309
    Reviewed-on: http://gerrit.cloudera.org:8080/20028
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 testdata/bin/kill-ranger-server.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/testdata/bin/kill-ranger-server.sh 
b/testdata/bin/kill-ranger-server.sh
index 8fd0ef268..d3c9b1aed 100755
--- a/testdata/bin/kill-ranger-server.sh
+++ b/testdata/bin/kill-ranger-server.sh
@@ -21,4 +21,12 @@ set -euo pipefail
 . $IMPALA_HOME/bin/report_build_error.sh
 setup_report_build_error
 
-"${RANGER_HOME}"/ews/ranger-admin-services.sh stop
\ No newline at end of file
+# If this directory doesn't exist, then the stop command will immediately error
+# trying to write to this directory. The stop won't be issued, and shutdown 
will
+# take 30 seconds longer.
+RANGER_LOG_DIR="${IMPALA_CLUSTER_LOGS_DIR}/ranger"
+if [[ ! -d "${RANGER_LOG_DIR}" ]]; then
+    mkdir -p "${RANGER_LOG_DIR}"
+fi
+
+"${RANGER_HOME}"/ews/ranger-admin-services.sh stop

Reply via email to