You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2020/06/11 13:04:40 UTC

[flink] 01/03: [FLINK-18217][conf] Explicitly check for empty string

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

chesnay pushed a commit to branch release-1.11
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 1fb76645c2f6b670ebf1bcc4ae758bdd6b52bf46
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Thu Jun 11 15:01:28 2020 +0200

    [FLINK-18217][conf] Explicitly check for empty string
    
    * [FLINK-18217][conf] Explicitly check for empty string
    
    * +
    
    * ++
---
 flink-dist/src/main/flink-bin/bin/config.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/flink-dist/src/main/flink-bin/bin/config.sh b/flink-dist/src/main/flink-bin/bin/config.sh
index 8917be9..a42863f 100755
--- a/flink-dist/src/main/flink-bin/bin/config.sh
+++ b/flink-dist/src/main/flink-bin/bin/config.sh
@@ -500,6 +500,11 @@ extractExecutionResults() {
 
     execution_results=$(echo "${output}" | grep ${EXECUTION_PREFIX})
     num_lines=$(echo "${execution_results}" | wc -l)
+    # explicit check for empty result, becuase if execution_results is empty, then wc returns 1
+    if [[ -z ${execution_results} ]]; then
+        echo "[ERROR] The execution result is empty." 1>&2
+        exit 1
+    fi
     if [[ ${num_lines} -ne ${expected_lines} ]]; then
         echo "[ERROR] The execution results has unexpected number of lines, expected: ${expected_lines}, actual: ${num_lines}." 1>&2
         echo "[ERROR] An execution result line is expected following the prefix '${EXECUTION_PREFIX}'" 1>&2