github-actions[bot] commented on PR #41070:
URL: https://github.com/apache/doris/pull/41070#issuecomment-2363301056

   #### `sh-checker report`
   
   To get the full details, please check in the 
[job]("https://github.com/apache/doris/actions/runs/10956934755";) output.
   
   <details>
   <summary>shellcheck errors</summary>
   
   ```
   
   'shellcheck ' returned error 1 finding the following syntactical issues:
   
   ----------
   
   In build.sh line 888:
   mkdir -p ${DORIS_HOME}/output/tools
            ^-----------^ SC2086 (info): Double quote to prevent globbing and 
word splitting.
   
   Did you mean: 
   mkdir -p "${DORIS_HOME}"/output/tools
   
   
   In build.sh line 889:
   cp -r -p tools/fdb   ${DORIS_HOME}/output/tools
                        ^-----------^ SC2086 (info): Double quote to prevent 
globbing and word splitting.
   
   Did you mean: 
   cp -r -p tools/fdb   "${DORIS_HOME}"/output/tools
   
   
   In tools/fdb/fdb_ctl.sh line 141:
       local min_processes=1
             ^-----------^ SC2034 (warning): min_processes appears unused. 
Verify use (or export if used externally).
   
   
   In tools/fdb/fdb_ctl.sh line 149:
       IFS=':' read -r num_storage num_stateless num_log <<< 
"$STORAGE_STATELESS_LOG_RATIO"
                                                              
^--------------------------^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
       IFS=':' read -r num_storage num_stateless num_log <<< 
"${STORAGE_STATELESS_LOG_RATIO}"
   
   
   In tools/fdb/fdb_ctl.sh line 159:
       if [ "#$MEDIUM_TYPE" = "#HDD" ]; then
          ^--------------------------^ SC2292 (style): Prefer [[ ]] over [ ] 
for tests in Bash/Ksh.
              ^----------^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
       if [[ "#${MEDIUM_TYPE}" = "#HDD" ]]; then
   
   
   In tools/fdb/fdb_ctl.sh line 199:
       IFS=',' read -r -a IPS <<<"$FDB_CLUSTER_IPS"
                                  ^--------------^ SC2250 (style): Prefer 
putting braces around variable references even when not strictly required.
   
   Did you mean: 
       IFS=',' read -r -a IPS <<<"${FDB_CLUSTER_IPS}"
   
   
   In tools/fdb/fdb_ctl.sh line 201:
       if [[ -z $(which ping) ]]; then
                  ^---^ SC2230 (info): 'which' is non-standard. Use builtin 
'command -v' instead.
   
   
   In tools/fdb/fdb_ctl.sh line 214:
       if [ ${CPU_CORES_LIMIT} -gt $(nproc) ]; then
          ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
            ^----------------^ SC2248 (style): Prefer double quoting even when 
variables don't contain special characters.
                                   ^------^ SC2046 (warning): Quote this to 
prevent word splitting.
   
   Did you mean: 
       if [[ "${CPU_CORES_LIMIT}" -gt $(nproc) ]]; then
   
   
   In tools/fdb/fdb_ctl.sh line 219:
       if [ ${MEMORY_LIMIT_GB} -gt $(free -g | awk '/^Mem:/{print $2}') ]; then
          ^-- SC2292 (style): Prefer [[ ]] over [ ] for tests in Bash/Ksh.
            ^----------------^ SC2248 (style): Prefer double quoting even when 
variables don't contain special characters.
                                   ^-- SC2046 (warning): Quote this to prevent 
word splitting.
   
   Did you mean: 
       if [[ "${MEMORY_LIMIT_GB}" -gt $(free -g | awk '/^Mem:/{print $2}') ]]; 
then
   
   
   In tools/fdb/fdb_ctl.sh line 241:
           if [ ! -z "$(ls -A ${DIR})" ]; then
              ^------------------------^ SC2292 (style): Prefer [[ ]] over [ ] 
for tests in Bash/Ksh.
                ^-- SC2236 (style): Use -n instead of ! -z.
                              ^----^ SC2086 (info): Double quote to prevent 
globbing and word splitting.
   
   Did you mean: 
           if [[ ! -z "$(ls -A "${DIR}")" ]]; then
   
   
   In tools/fdb/fdb_ctl.sh line 279:
       if [ $storage_processes -eq 0 ]; then
          ^--------------------------^ SC2292 (style): Prefer [[ ]] over [ ] 
for tests in Bash/Ksh.
            ^----------------^ SC2086 (info): Double quote to prevent globbing 
and word splitting.
            ^----------------^ SC2250 (style): Prefer putting braces around 
variable references even when not strictly required.
   
   Did you mean: 
       if [[ "${storage_processes}" -eq 0 ]]; then
   
   
   In tools/fdb/fdb_ctl.sh line 424:
       echo "fdb_cluster = $(cat ${FDB_HOME}/conf/fdb.cluster)"
                                 ^---------^ SC2248 (style): Prefer double 
quoting even when variables don't contain special characters.
   
   Did you mean: 
       echo "fdb_cluster = $(cat "${FDB_HOME}"/conf/fdb.cluster)"
   
   For more information:
     https://www.shellcheck.net/wiki/SC2034 -- min_processes appears unused. 
Ver...
     https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word 
splitt...
     https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing 
...
   ----------
   
   You can address the above issues in one of three ways:
   1. Manually correct the issue in the offending shell script;
   2. Disable specific issues by adding the comment:
     # shellcheck disable=NNNN
   above the line that contains the issue, where NNNN is the error code;
   3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.
   
   
   
   ```
   </details>
   
   <details>
   <summary>shfmt errors</summary>
   
   ```
   
   'shfmt ' returned error 1 finding the following formatting issues:
   
   ----------
   --- build.sh.orig
   +++ build.sh
   @@ -886,7 +886,7 @@
    fi
    
    mkdir -p ${DORIS_HOME}/output/tools
   -cp -r -p tools/fdb   ${DORIS_HOME}/output/tools
   +cp -r -p tools/fdb ${DORIS_HOME}/output/tools
    
    echo "***************************************"
    echo "Successfully build Doris"
   --- tools/fdb/fdb_ctl.sh.orig
   +++ tools/fdb/fdb_ctl.sh
   @@ -146,47 +146,47 @@
        data_dir_count=${#DATA_DIR_ARRAY[@]}
    
        # Parse the ratio input
   -    IFS=':' read -r num_storage num_stateless num_log <<< 
"$STORAGE_STATELESS_LOG_RATIO"
   +    IFS=':' read -r num_storage num_stateless num_log 
<<<"$STORAGE_STATELESS_LOG_RATIO"
    
        # Initialize process counts
   -    local storage_processes=0  # Storage processes
   +    local storage_processes=0   # Storage processes
        local stateless_processes=0 # Stateless processes
   -    local log_processes=0  # Log processes
   +    local log_processes=0       # Log processes
    
   -    local storage_process_num_limit=$(( STORAGE_PROCESSES_NUM_PER_SSD * 
data_dir_count ))
   -    local log_process_num_limit=$(( LOG_PROCESSES_NUM_PER_SSD * 
data_dir_count ))
   +    local storage_process_num_limit=$((STORAGE_PROCESSES_NUM_PER_SSD * 
data_dir_count))
   +    local log_process_num_limit=$((LOG_PROCESSES_NUM_PER_SSD * 
data_dir_count))
    
        if [ "#$MEDIUM_TYPE" = "#HDD" ]; then
   -        storage_process_num_limit=$(( STORAGE_PROCESSES_NUM_PER_HDD * 
data_dir_count ))
   -        log_process_num_limit=$(( LOG_PROCESSES_NUM_PER_HDD * 
data_dir_count))
   +        storage_process_num_limit=$((STORAGE_PROCESSES_NUM_PER_HDD * 
data_dir_count))
   +        log_process_num_limit=$((LOG_PROCESSES_NUM_PER_HDD * 
data_dir_count))
        fi
    
        # Find maximum number of processes while maintaining the specified ratio
        while true; do
            # Calculate process counts based on the ratio
   -        storage_processes=$(( storage_processes + num_storage ))
   -        stateless_processes=$(( storage_processes * num_stateless / 
num_storage ))
   -        log_processes=$(( storage_processes * num_log / num_storage ))
   +        storage_processes=$((storage_processes + num_storage))
   +        stateless_processes=$((storage_processes * num_stateless / 
num_storage))
   +        log_processes=$((storage_processes * num_log / num_storage))
    
            # Calculate total CPUs used
   -        local total_cpu_used=$(( storage_processes + stateless_processes + 
log_processes ))
   +        local total_cpu_used=$((storage_processes + stateless_processes + 
log_processes))
    
            # Check memory constraint
   -        local total_memory_used=$(( (MEMORY_STORAGE_GB * storage_processes) 
+ (MEMORY_STATELESS_GB * stateless_processes) + (MEMORY_LOG_GB * log_processes) 
))
   +        local total_memory_used=$(((MEMORY_STORAGE_GB * storage_processes) 
+ (MEMORY_STATELESS_GB * stateless_processes) + (MEMORY_LOG_GB * 
log_processes)))
    
            # Check datadir limits
   -        if ((storage_processes > storage_process_num_limit || log_processes 
> log_process_num_limit )); then
   +        if ((storage_processes > storage_process_num_limit || log_processes 
> log_process_num_limit)); then
                break
            fi
    
            # Check overall constraints
   -        if (( total_memory_used <= memory_limit_gb && total_cpu_used <= 
cpu_cores_limit )); then
   +        if ((total_memory_used <= memory_limit_gb && total_cpu_used <= 
cpu_cores_limit)); then
                continue
            else
                # If constraints are violated, revert back
   -            storage_processes=$(( storage_processes - num_storage ))
   -            stateless_processes=$(( storage_processes * num_stateless / 
num_storage ))
   -            log_processes=$((storage_processes * num_log / num_storage ))
   +            storage_processes=$((storage_processes - num_storage))
   +            stateless_processes=$((storage_processes * num_stateless / 
num_storage))
   +            log_processes=$((storage_processes * num_log / num_storage))
                break
            fi
        done
   @@ -203,14 +203,14 @@
        fi
    
        for IP_ADDRESS in "${IPS[@]}"; do
   -        if ping -c 1 "${IP_ADDRESS}" &> /dev/null; then
   +        if ping -c 1 "${IP_ADDRESS}" &>/dev/null; then
                echo "${IP_ADDRESS} is reachable"
            else
                echo "${IP_ADDRESS} is not reachable"
                exit 1
            fi
        done
   -    
   +
        if [ ${CPU_CORES_LIMIT} -gt $(nproc) ]; then
            echo "CPU_CORES_LIMIT beyonds number of machine, which is $(nproc)"
            exit 1
   @@ -414,10 +414,10 @@
            echo "Try create database in fdb ${fdb_mode}"
    
            "${FDB_HOME}/fdbcli" -C "${FDB_HOME}/conf/fdb.cluster" \
   -            --exec "configure new ${fdb_mode} ssd" || \
   -            "${FDB_HOME}/fdbcli" -C "${FDB_HOME}/conf/fdb.cluster" --exec 
"status" || \
   -            (echo "failed to start fdb, please check that all nodes have 
same FDB_CLUSTER_ID" && \
   -            exit 1)
   +            --exec "configure new ${fdb_mode} ssd" ||
   +            "${FDB_HOME}/fdbcli" -C "${FDB_HOME}/conf/fdb.cluster" --exec 
"status" ||
   +            (echo "failed to start fdb, please check that all nodes have 
same FDB_CLUSTER_ID" &&
   +                exit 1)
        fi
    
        echo "Start fdb success, and you can set conf for MetaService:"
   --- tools/fdb/fdb_vars.sh.orig
   +++ tools/fdb/fdb_vars.sh
   ----------
   
   You can reformat the above files to meet shfmt's requirements by typing:
   
     shfmt  -w filename
   
   
   ```
   </details>
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to