Github user HeartSaVioR commented on a diff in the pull request:
https://github.com/apache/storm/pull/1963#discussion_r104916741
--- Diff:
storm-core/src/jvm/org/apache/storm/daemon/supervisor/BasicContainer.java ---
@@ -411,10 +413,17 @@ private String substituteChildOptsInternal(String
string, int memOnheap) {
if (value instanceof String) {
String string = substituteChildOptsInternal((String) value,
memOnheap);
if (StringUtils.isNotBlank(string)) {
- String[] strings = string.split("\\s+");
- for (String s: strings) {
- if (StringUtils.isNotBlank(s)) {
- rets.add(s);
+ /* This pattern matches
+ * 1.everything starts with -XX:\w+ or -D[\w.]+ and
followed with quoted (both ' and ") strings
+ * 2.everything without \s, ' and " in it
+ * This will solve the problem which params like
-XX:OnError="pstack %p >~/pstack%p.log" will be split into pieces
+ */
+ Matcher m=
Pattern.compile("(?:-XX:\\w+|-D[\\w.]+)=((?<![\\\\])['\\\"])((?:.(?!(?<![\\\\])\\1))*.?)\\1|[^\\s\\\"']+")
--- End diff --
Could we have various test cases to cover whether it's working?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---