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

Chia-Ping Tsai commented on HBASE-18651:
----------------------------------------

{code}
+  @Override
+  public void close() throws IOException {
+    executor.shutdown();
+    try {
+      while (!executor.awaitTermination(1000, TimeUnit.MILLISECONDS));
+    } catch (InterruptedException e) {
+      Thread.currentThread().interrupt();
+      LOG.warn("Interruption occured while stopping chaos monkeys " + e);
+    }
+  }
{code}
If you want to wait shutdown forever, the 
{{executor.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS)}} is more 
suitable. The while loop is redundant.

> Let ChaosMonkeyRunner expose the chaos monkey runner it creates
> ---------------------------------------------------------------
>
>                 Key: HBASE-18651
>                 URL: https://issues.apache.org/jira/browse/HBASE-18651
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Ted Yu
>            Assignee: Reid Chan
>         Attachments: HBASE-18651.master.001.patch, 
> HBASE-18651.master.002.patch, HBASE-18651.master.003.patch
>
>
> Currently ChaosMonkeyRunner#main() instantiates ChaosMonkeyRunner without 
> keeping track of the instance.
> This poses some challenge when ChaosMonkeyRunner is used programmatically 
> because the caller cannot get hold of the runner.
> As [~mdrob] suggested, we should expose the chaos monkey runner.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to