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

    https://github.com/apache/incubator-twill/pull/41#discussion_r32368035
  
    --- Diff: 
twill-zookeeper/src/main/java/org/apache/twill/internal/zookeeper/DefaultZKClientService.java
 ---
    @@ -420,23 +444,18 @@ protected void terminated() {
     
         @Override
         protected void doStop() {
    -      ZooKeeper zk = zooKeeper.getAndSet(null);
    -      if (zk != null) {
    -        try {
    -          zk.close();
    -        } catch (InterruptedException e) {
    -          notifyFailed(e);
    -        } finally {
    -          eventExecutor.shutdown();
    -          executorStopped = true;
    -
    -          // If the executor state is terminated, meaning the terminate() 
method is triggered,
    -          // call notifyStopped() if it hasn't been called yet.
    -          if (eventExecutor.isTerminated() && 
stopNotified.compareAndSet(false, true)) {
    +      eventExecutor.submit(new Runnable() {
    --- End diff --
    
    Why we need to run stop on separate thread?


---
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.
---

Reply via email to