From d6c7d868cdb450c2d2064d324b3da124d2a491b6 Mon Sep 17 00:00:00 2001 From: Maytas Monsereenusorn Date: Sun, 16 Jun 2024 09:18:44 +0700 Subject: [PATCH] Fix peon startup with non string property value (#16612) --- .../druid/indexing/overlord/ForkingTaskRunner.java | 11 +++++++---- .../indexing/overlord/ForkingTaskRunnerTest.java | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java index e946fc6149b..c676877c110 100644 --- a/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java +++ b/indexing-service/src/main/java/org/apache/druid/indexing/overlord/ForkingTaskRunner.java @@ -314,10 +314,13 @@ public class ForkingTaskRunner if (context != null) { for (String propName : context.keySet()) { if (propName.startsWith(CHILD_PROPERTY_PREFIX)) { - command.addSystemProperty( - propName.substring(CHILD_PROPERTY_PREFIX.length()), - task.getContextValue(propName) - ); + Object contextValue = task.getContextValue(propName); + if (contextValue != null) { + command.addSystemProperty( + propName.substring(CHILD_PROPERTY_PREFIX.length()), + String.valueOf(contextValue) + ); + } } } } diff --git a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/ForkingTaskRunnerTest.java b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/ForkingTaskRunnerTest.java index 2c17b3cb7c4..56695e5cf27 100644 --- a/indexing-service/src/test/java/org/apache/druid/indexing/overlord/ForkingTaskRunnerTest.java +++ b/indexing-service/src/test/java/org/apache/druid/indexing/overlord/ForkingTaskRunnerTest.java @@ -392,6 +392,7 @@ public class ForkingTaskRunnerTest + " \"firehose\" : null,\n" + " \"context\" : {\n" + " \"druid.indexer.runner.javaOptsArray\" : [ \"-Xmx10g\", \"-Xms10g\" ],\n" + + " \"druid.indexer.fork.property.druid.processing.numThreads\" : 4,\n" + " \"druid.indexer.runner.javaOpts\" : \"-Xmx1g -Xms1g\"\n" + " }\n" + "}";