Github user anwar6953 commented on a diff in the pull request: https://github.com/apache/twill/pull/6#discussion_r76372340 --- Diff: twill-yarn/src/main/hadoop21/org/apache/twill/internal/yarn/Hadoop21YarnAppClient.java --- @@ -58,16 +58,24 @@ public final class Hadoop21YarnAppClient extends AbstractIdleService implements YarnAppClient { private static final Logger LOG = LoggerFactory.getLogger(Hadoop21YarnAppClient.class); - private final YarnClient yarnClient; + private final Configuration configuration; public Hadoop21YarnAppClient(Configuration configuration) { - this.yarnClient = YarnClient.createYarnClient(); + this.configuration = configuration; + } + + // Creates and starts a yarn client + private YarnClient createYarnClient() { + YarnClient yarnClient = YarnClient.createYarnClient(); yarnClient.init(configuration); + yarnClient.start(); + return yarnClient; } @Override public ProcessLauncher<ApplicationMasterInfo> createLauncher(TwillSpecification twillSpec, @Nullable String schedulerQueue) throws Exception { + final YarnClient yarnClient = createYarnClient(); --- End diff -- It gets passed into and used by the `ProcessControllerImpl` at the end of the `createLauncher` method. It gets stopped when `cancel` is called on the `ProcessControllerImpl` (defined at the bottom of this class).
--- 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. ---