[ https://issues.apache.org/jira/browse/TEZ-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14151378#comment-14151378 ]
Jeff Zhang commented on TEZ-1620: --------------------------------- [~bikassaha] Attach the patch which add waiting for all applications finished in MiniTezCluster.stop(). Regarding the sleep issue, I think the sleep is only needed in non-session mode, because in session mode, the shutdown is triggered by client which means the client has known all the dags are all completed. But in non-session mode, we don't allow client to control the lifecycle of AM. One easy way that I can think of is that we can set a flag in DAGClientHandler.getDAGStatus() when DAGStatus is in completed state. Regarding the the sleep issue in local mode, we may need to look for other solution to not call system.exit(). > Wait for application finish before stopping MiniTezCluster > ---------------------------------------------------------- > > Key: TEZ-1620 > URL: https://issues.apache.org/jira/browse/TEZ-1620 > Project: Apache Tez > Issue Type: Bug > Reporter: Jeff Zhang > Assignee: Jeff Zhang > > Currently, we sleep 10 seconds to wait for DAGAppMaster to finish, otherwise > DAGAppMaster will hang there for connecting RM to unregister. > We should wait for all the applications finish before stopping > MiniTezCluster. -- This message was sent by Atlassian JIRA (v6.3.4#6332)