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