Fix peon startup with non string property value (#16612)

This commit is contained in:
Maytas Monsereenusorn 2024-06-16 09:18:44 +07:00 committed by GitHub
parent aec1d5ddd6
commit d6c7d868cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -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)
);
}
}
}
}

View File

@ -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"
+ "}";