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

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


The following commit(s) were added to refs/heads/main by this push:
     new 1b3bd6eb3 [CELEBORN-1802] Fail the celeborn master/worker start if 
CELEBORN_CONF_DIR is not directory
1b3bd6eb3 is described below

commit 1b3bd6eb38ef05b5f29c94165259ee62dd27c965
Author: Wang, Fei <[email protected]>
AuthorDate: Thu Dec 26 20:22:34 2024 +0800

    [CELEBORN-1802] Fail the celeborn master/worker start if CELEBORN_CONF_DIR 
is not directory
    
    ### What changes were proposed in this pull request?
    Fail the celeborn master/worker start if `CELEBORN_CONF_DIR` is not 
directory. Otherwise, the  process would run into unexpected status.
    
    ### Why are the changes needed?
    In the  `celeborn-daemon.sh` , if we specify the `--config <conf-dir>` 
option. It would fail the master/worker start if the `conf-dir` is not a 
directory,  likes the systemctl `ConditionPathExists=$CELEBORN_CONF_DIR` 
requirement check.
    
    
https://github.com/apache/celeborn/blob/fde6365f68ce8b589bcc639e96476ed618249257/sbin/celeborn-daemon.sh#L35
    
    
https://github.com/apache/celeborn/blob/fde6365f68ce8b589bcc639e96476ed618249257/sbin/celeborn-daemon.sh#L53-L62
    
    But before this PR, for the start master/worker scripts, it did not check 
if the `CELEBORN_CONF_DIR` is dirctory because the scripts did not leverage 
`--config <conf-dir>` option.
    
    In this PR, we check the final `CELEBORN_CONF_DIR` before start celeborn, 
so that all the scripts would check if the `CELEBORN_CONF_DIR` is a directory 
before start.
    ### Does this PR introduce _any_ user-facing change?
    Yes, it would fail the start if  `CELEBORN_CONF_DIR` is not a directory.
    
    ### How was this patch tested?
    
    <img width="840" alt="image" 
src="https://github.com/user-attachments/assets/e670d21b-cb01-4fa6-8a2f-c94dc06cce4a";
 />
    
    Closes #3030 from turboFei/check_config_dir.
    
    Authored-by: Wang, Fei <[email protected]>
    Signed-off-by: mingji <[email protected]>
---
 sbin/celeborn-daemon.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sbin/celeborn-daemon.sh b/sbin/celeborn-daemon.sh
index b4c2cc4c6..fa1ffd3c5 100755
--- a/sbin/celeborn-daemon.sh
+++ b/sbin/celeborn-daemon.sh
@@ -166,6 +166,11 @@ run_command() {
 }
 
 start_celeborn() {
+    if [ ! -d "$CELEBORN_CONF_DIR" ]
+    then
+      echo "ERROR : CELEBORN_CONF_DIR: $CELEBORN_CONF_DIR is not a directory"
+      exit 1
+    fi
     run_command class "$@"
 }
 

Reply via email to