hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tsuyoshi OZAWA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-2921) MockRM#waitForState methods can be too slow and flaky
Date Thu, 04 Dec 2014 19:45:14 GMT

    [ https://issues.apache.org/jira/browse/YARN-2921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14234540#comment-14234540

Tsuyoshi OZAWA commented on YARN-2921:

Thanks for your suggestion, Karthik. I agree with that we should use wait-by-loop approach
in this case. I'll update it in a next patch.

Other than the smaller sleep, we should also handle the case where the App or AppAttempt enters
the required state and then moves to a latter state. e.g. App moving to RUNNING state when
we are waiting for it to get ACCEPTED.

I spent some time how I can implement it - how about using variadic as a argument of waitFor()?
This will work without changing code.

  public void waitForState(RMAppAttemptState... finalStatesArray)
      throws Exception {
    EnumSet<RMAppAttemptState> finalStates
        = EnumSet.copyOf(Arrays.asList(finalStatesArray));
    while (!finalStates.contains(attempt.getAppAttemptState()) && !isTimeout() {

> MockRM#waitForState methods can be too slow and flaky
> -----------------------------------------------------
>                 Key: YARN-2921
>                 URL: https://issues.apache.org/jira/browse/YARN-2921
>             Project: Hadoop YARN
>          Issue Type: Improvement
>          Components: test
>    Affects Versions: 2.6.0
>            Reporter: Karthik Kambatla
>            Assignee: Tsuyoshi OZAWA
>         Attachments: YARN-2921.001.patch
> MockRM#waitForState methods currently sleep for too long (2 seconds and 1 second). This
leads to slow tests and sometimes failures if the App/AppAttempt moves to another state. 

This message was sent by Atlassian JIRA

View raw message