[ https://issues.apache.org/jira/browse/YARN-4313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14979956#comment-14979956 ]
Jian He commented on YARN-4313: ------------------------------- [~gtCarrera9], thanks for taking a look at this. This variable needs to be declared as final since it's accessed from within an inner class. So a boolean flag may not work as it cannot be reset ? > Race condition in MiniMRYarnCluster when getting history server address > ----------------------------------------------------------------------- > > Key: YARN-4313 > URL: https://issues.apache.org/jira/browse/YARN-4313 > Project: Hadoop YARN > Issue Type: Bug > Reporter: Jian He > Assignee: Jian He > Attachments: YARN-4313.1.patch > > > Problem in this place when waiting for JHS to be started > {code} > new Thread() { > public void run() { > historyServer.start(); > }; > }.start(); > while (historyServer.getServiceState() == STATE.INITED) { > LOG.info("Waiting for HistoryServer to start..."); > Thread.sleep(1500); > } > {code} > The service state is updated before the service is actually started. See > AbstractServic#start. So it's possible that when the while loop breaks, the > service is not yet started. -- This message was sent by Atlassian JIRA (v6.3.4#6332)