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

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


The following commit(s) were added to refs/heads/master by this push:
     new d056d06fff0 Fix single container config creates failing peon tasks 
(#17794)
d056d06fff0 is described below

commit d056d06fff01856cada59c51c22bf32d2a32941c
Author: Virushade <[email protected]>
AuthorDate: Mon Mar 17 20:55:14 2025 +0800

    Fix single container config creates failing peon tasks (#17794)
    
    * Fix single container config creates failing peon tasks
    
    * More obvious array error output
---
 distribution/docker/peon.sh                              | 6 +++++-
 services/src/main/java/org/apache/druid/cli/CliPeon.java | 7 +++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/distribution/docker/peon.sh b/distribution/docker/peon.sh
index 3b4dfc4326b..444aec94e9a 100755
--- a/distribution/docker/peon.sh
+++ b/distribution/docker/peon.sh
@@ -161,4 +161,8 @@ fi
 # If TASK_JSON is not set, CliPeon will pull the task.json file from deep 
storage.
 mkdir -p ${TASK_DIR}; [ -n "$TASK_JSON" ] && echo ${TASK_JSON} | base64 -d | 
gzip -d > ${TASK_DIR}/task.json;
 
-exec bin/run-java ${JAVA_OPTS} -cp $COMMON_CONF_DIR:$SERVICE_CONF_DIR:lib/*: 
org.apache.druid.cli.Main internal peon --taskId ${TASK_ID} $@
+if [ -n "$TASK_ID" ]; then
+    exec bin/run-java ${JAVA_OPTS} -cp 
$COMMON_CONF_DIR:$SERVICE_CONF_DIR:lib/*: org.apache.druid.cli.Main internal 
peon --taskId "${TASK_ID}" "$@"
+else
+    exec bin/run-java ${JAVA_OPTS} -cp 
$COMMON_CONF_DIR:$SERVICE_CONF_DIR:lib/*: org.apache.druid.cli.Main internal 
peon "$@"
+fi
diff --git a/services/src/main/java/org/apache/druid/cli/CliPeon.java 
b/services/src/main/java/org/apache/druid/cli/CliPeon.java
index 307ba269a4f..3d06ad7dee3 100644
--- a/services/src/main/java/org/apache/druid/cli/CliPeon.java
+++ b/services/src/main/java/org/apache/druid/cli/CliPeon.java
@@ -24,6 +24,7 @@ import com.github.rvesse.airline.annotations.Arguments;
 import com.github.rvesse.airline.annotations.Command;
 import com.github.rvesse.airline.annotations.Option;
 import com.github.rvesse.airline.annotations.restrictions.Required;
+import com.google.common.base.Preconditions;
 import com.google.common.base.Supplier;
 import com.google.common.base.Throwables;
 import com.google.common.collect.ImmutableList;
@@ -234,6 +235,12 @@ public class CliPeon extends GuiceRunnable
           public void configure(Binder binder)
           {
             
ServerRunnable.validateCentralizedDatasourceSchemaConfig(getProperties());
+            Preconditions.checkArgument(
+                taskAndStatusFile.size() >= 2,
+                "taskAndStatusFile array should contain 2 or more elements. 
Current array elements: [%s]",
+                taskAndStatusFile.toString()
+            );
+
             taskDirPath = taskAndStatusFile.get(0);
             attemptId = taskAndStatusFile.get(1);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to