[ 
https://issues.apache.org/jira/browse/STORM-1336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15135122#comment-15135122
 ] 

ASF GitHub Bot commented on STORM-1336:
---------------------------------------

Github user knusbaum commented on a diff in the pull request:

    https://github.com/apache/storm/pull/1053#discussion_r52079277
  
    --- Diff: storm-core/src/jvm/org/apache/storm/utils/Utils.java ---
    @@ -1367,12 +1367,67 @@ public static int toPositive(int number) {
             return number & Integer.MAX_VALUE;
         }
     
    -    public static RuntimeException wrapInRuntime(Exception e){
    -        if (e instanceof RuntimeException){
    -            return (RuntimeException)e;
    -        }else {
    +    public static RuntimeException wrapInRuntime(Exception e) {
    +        if (e instanceof RuntimeException) {
    +            return (RuntimeException) e;
    +        } else {
                 return new RuntimeException(e);
             }
         }
    +
    +    public static void ensure_process_killed(Integer pid) {
    +        // in this function, just kill the process 5 times
    +        // make sure the process be killed definitely
    +        for (int i = 0; i < 5; i++) {
    +            try {
    +                exec_command("kill -9 " + pid);
    +                LOG.info("kill -9 process " + pid);
    +                sleepMs(100);
    +            } catch (ExecuteException e) {
    +                LOG.info("Error when trying to kill " + pid + ". Process 
has been killed");
    +                return;
    +            } catch (Exception e) {
    +                LOG.info("Error when trying to kill " + pid + ".Exception 
", e);
    +            }
    +        }
    +    }
    +
    +    public static void process_killed(Integer pid) {
    +        try {
    +            exec_command("kill " + pid);
    +            LOG.info("kill process " + pid);
    +        } catch (ExecuteException e) {
    +            LOG.info("Error when trying to kill " + pid + ". Process has 
been killed. ");
    +        } catch (Exception e) {
    +            LOG.info("Error when trying to kill " + pid + ".Exception ", 
e);
    +        }
    +    }
    +
    +    public static void kill(Integer pid) {
    --- End diff --
    
    We already have process killing stuff in Util.java.


> Evalute/Port JStorm cgroup support
> ----------------------------------
>
>                 Key: STORM-1336
>                 URL: https://issues.apache.org/jira/browse/STORM-1336
>             Project: Apache Storm
>          Issue Type: New Feature
>          Components: storm-core
>            Reporter: Robert Joseph Evans
>            Assignee: Boyang Jerry Peng
>              Labels: jstorm-merger
>
> Supports controlling the upper limit of CPU core usage for a worker using 
> cgroups
> Sounds like a good start, will be nice to integrate it with RAS requests too.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to