Skip to content

Peon javaOpts are not quoted or escaped when passing to the Peon #1841

@drcrallen

Description

@drcrallen

Related to #1827
And #1748
But the logic in ForkingTaskRunner as per

for (String propName : props.stringPropertyNames()) {
  for (String allowedPrefix : config.getAllowedPrefixes()) {
    if (propName.startsWith(allowedPrefix)) {
      command.add(String.format( "-D%s=%s", propName, props.getProperty(propName)));
    }
  }
}

Does not escape or quote the java options properly. This causes properties like druid.indexer.runner.javaOpts=-server -Xmx256m -XX:OnOutOfMemoryError=\\\"kill -9 %p\\\" to be placed on the java command line as druid.indexer.runner.javaOpts=-server -Xmx256m -XX:OnOutOfMemoryError="kill -9 %p" which fails because

#
# java.lang.OutOfMemoryError: Java heap space
# -XX:OnOutOfMemoryError=""kill -9 %p""
#   Executing /bin/sh -c ""kill -9 55925""...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions