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

    https://github.com/apache/twill/pull/6#discussion_r76685965
  
    --- Diff: 
twill-yarn/src/main/hadoop20/org/apache/twill/internal/yarn/Hadoop20YarnAppClient.java
 ---
    @@ -176,22 +184,27 @@ private void addRMToken(ContainerLaunchContext 
context) {
     
       @Override
       public ProcessController<YarnApplicationReport> 
createProcessController(ApplicationId appId) {
    -    return new ProcessControllerImpl(yarnClient, appId);
    +    return new ProcessControllerImpl(createYarnClient(), appId);
       }
     
       @Override
       public List<NodeReport> getNodeReports() throws Exception {
    -    return this.yarnClient.getNodeReports();
    +    YarnClient yarnClient = createYarnClient();
    +    try {
    +      return yarnClient.getNodeReports();
    +    } finally {
    +      yarnClient.stop();
    +    }
       }
     
       @Override
       protected void startUp() throws Exception {
    -    yarnClient.start();
    +    // no-op. We will create and start YarnClients, on demand
    --- End diff --
    
    Maybe we should make `YarnAppClient` not a `Service` at all. It seems like 
there is no need for any lifecycle management.


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