[
https://issues.apache.org/jira/browse/FLINK-6581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16010475#comment-16010475
]
ASF GitHub Bot commented on FLINK-6581:
---------------------------------------
Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/3903#discussion_r116485611
--- Diff:
flink-yarn/src/main/java/org/apache/flink/yarn/cli/FlinkYarnSessionCli.java ---
@@ -702,9 +702,15 @@ private void logAndSysout(String message) {
continue;
}
- String[] kv = propLine.split("=");
- if (kv.length >= 2 && kv[0] != null && kv[1] !=
null && kv[0].length() > 0) {
- properties.put(kv[0], kv[1]);
+ int firstEquals = propLine.indexOf("=");
+
+ if (firstEquals >= 0) {
+ String key = propLine.substring(0,
firstEquals).trim();
+ String value =
propLine.substring(firstEquals + 1, propLine.length()).trim();
+
+ if (!key.isEmpty() && !value.isEmpty())
{
--- End diff --
We didn't reject empty values before. Not sure if there's a valid use-case
for that though, maybe overriding/clearing some variable?
> Dynamic property parsing broken for YARN
> ----------------------------------------
>
> Key: FLINK-6581
> URL: https://issues.apache.org/jira/browse/FLINK-6581
> Project: Flink
> Issue Type: Bug
> Components: YARN
> Affects Versions: 1.3.0, 1.4.0
> Reporter: Till Rohrmann
> Assignee: Till Rohrmann
>
> The dynamic property parsing in YARN is broken. For example, the following
> dynamic property won't be parsed properly:
> {{-yDenv.java.opts="-DappName=foobar -Did=1"}}. The result will be equivalent
> to {{-yDenv.java.opts="-DappName"}}.
> The problem is that {{FlinkYarnSessionCli#getDynamicProperties}} assumes that
> all dynamic properties have the form {{-D<KEY>=<VALUE>}} where {{<VALUE>}}
> does not contain any {{=}}.
> I propose to change the parsing of the dynamic properties string such that it
> splits the key-value pair not via {{dynamicProperties.split("=")}} but that
> we split the dynamic properties string at the first occurrence of the {{=}}.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)