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

    https://github.com/apache/twill/pull/2#discussion_r75177188
  
    --- Diff: 
twill-yarn/src/main/java/org/apache/twill/internal/appmaster/RunningContainers.java
 ---
    @@ -222,14 +231,17 @@ private void removeInstanceById(String runnableName, 
int instanceId) {
     
         Preconditions.checkState(containerId != null,
                                  "No container found for {} with instanceId = 
{}", runnableName, instanceId);
    +    return controller;
    +  }
     
    +  // This method only stops a runnable using the controller.
    +  // The cleanup of the state happens when handleCompleted() method runs 
for the runnable after the stop
    +  // This method will block until handleCompleted() method runs or a 
timeout occurs
    +  // Hence this method should not be called with a containerLock taken
    +  private void stopInstanceAndWait(String runnableName, 
TwillContainerController controller) {
         LOG.info("Stopping service: {} {}", runnableName, 
controller.getRunId());
    +    // This call will block until handleCompleted() method runs or a 
timeout occurs
         controller.stopAndWait();
    -    containers.remove(runnableName, containerId);
    --- End diff --
    
    Where do we do the removal of containers now?


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

Reply via email to