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

ASF GitHub Bot commented on TWILL-190:
--------------------------------------

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

    https://github.com/apache/twill/pull/2#discussion_r75424881
  
    --- Diff: 
twill-core/src/main/java/org/apache/twill/internal/TwillContainerLauncher.java 
---
    @@ -153,21 +155,29 @@ public TwillContainerController start(RunId runId, 
int instanceId, Class<?> main
           .addCommand(firstCommand, command.toArray(new 
String[command.size()]))
           .launch();
     
    -    TwillContainerControllerImpl controller = new 
TwillContainerControllerImpl(zkClient, runId, processController);
    +    TwillContainerControllerImpl controller =
    +      new TwillContainerControllerImpl(zkClient, runId, 
runtimeSpec.getName(), instanceId, processController);
         controller.start();
         return controller;
       }
     
       private static final class TwillContainerControllerImpl extends 
AbstractZKServiceController
                                                               implements 
TwillContainerController {
     
    +    private final String runnable;
    +    private final int instanceId;
         private final ProcessController<Void> processController;
    +    // This latch can be used to wait for container shutdown
    +    private final CountDownLatch shutdownLatch;
         private volatile ContainerLiveNodeData liveData;
     
    -    protected TwillContainerControllerImpl(ZKClient zkClient, RunId runId,
    +    protected TwillContainerControllerImpl(ZKClient zkClient, RunId runId, 
String runnable, int instanceId,
                                                ProcessController<Void> 
processController) {
           super(runId, zkClient);
    +      this.runnable = runnable;
    +      this.instanceId = instanceId;
           this.processController = processController;
    +      this.shutdownLatch = new CountDownLatch(1);
    --- End diff --
    
    I am confused, so the `CountDownLatch` is own as private member and being 
set in another method within a same instance?


> Restart of a TwillRunnable does not wait for the runnable to stop
> -----------------------------------------------------------------
>
>                 Key: TWILL-190
>                 URL: https://issues.apache.org/jira/browse/TWILL-190
>             Project: Apache Twill
>          Issue Type: Bug
>          Components: core, yarn
>    Affects Versions: 0.6.0-incubating, 0.7.0-incubating
>            Reporter: Poorna Chandra
>            Assignee: Poorna Chandra
>             Fix For: 0.8.0
>
>
> Today when a TwillRunnable is restarted, the call sends a stop message to the 
> TwillRunnable, and then starts new TwillRunnable without waiting for the 
> stopping runnable to finish stopping.
> This can leave a non-responding TwillRunnable container running, and can lead 
> to issues like two TwillRunnables with same instance id running at the same 
> time.
> We should kill the containers that don't respond to stop message.



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

Reply via email to