You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by nilday <gi...@git.apache.org> on 2017/02/24 11:51:37 UTC

[GitHub] storm pull request #1963: STORM-2380 worker.childopts with whitespace inside...

GitHub user nilday opened a pull request:

    https://github.com/apache/storm/pull/1963

    STORM-2380 worker.childopts with whitespace inside one param

     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


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nilday/storm master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/storm/pull/1963.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1963
    
----
commit f221828b81b3fde4e52dd8f0b9fab1fb6cbb3566
Author: howard.li <ho...@vipshop.com>
Date:   2017-02-24T10:02:08Z

    modify BasicContainer.substituteChildOpts to deal with opts with space inside it.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm pull request #1963: STORM-2380 worker.childopts with whitespace inside...

Posted by HeartSaVioR <gi...@git.apache.org>.
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] storm issue #1963: STORM-2380 worker.childopts with whitespace inside one pa...

Posted by HeartSaVioR <gi...@git.apache.org>.
Github user HeartSaVioR commented on the issue:

    https://github.com/apache/storm/pull/1963
  
    @nilday Any updates?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---