[ https://issues.apache.org/jira/browse/YARN-6215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15885080#comment-15885080 ]
Tao Jie commented on YARN-6215: ------------------------------- [~kasha] thank you for you comments and patch updated. {quote} lock() should be called outside the try-block {quote} I didn't think much about it before. {{lock()}} inside and outside the try-block both exist in current code. I checked some discussions at stackOverFlow, {{lock()}} itself does not throw checked exception but in case it throws unchecked exception(maybe it would hardly happen), {{unlock()}} should not be invoked. So {{lock()}} outside try-block is the better practice. Is it necessary to move existing {{lock()}} outside try-block? At least in {{FairScheduler.java}} most {{lock()}} is inside try-block now. > TestFairSchedulerPreemption.testPreemptionBetweenNonSiblingQueues fails in > trunk > -------------------------------------------------------------------------------- > > Key: YARN-6215 > URL: https://issues.apache.org/jira/browse/YARN-6215 > Project: Hadoop YARN > Issue Type: Sub-task > Components: fairscheduler, test > Reporter: Sunil G > Assignee: Tao Jie > Attachments: YARN-6215.001.patch, YARN-6215.002.patch > > > *Error Message* > Incorrect number of containers on the greedy app expected:<4> but was:<8> > Failed test case > [link|https://builds.apache.org/job/PreCommit-YARN-Build/15038/testReport/org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair/TestFairSchedulerPreemption/testPreemptionBetweenNonSiblingQueues_FairSharePreemptionWithDRF_/] > *Stacktrace* > {noformat} > java.lang.AssertionError: Incorrect number of containers on the greedy app > expected:<4> but was:<8> > at org.junit.Assert.fail(Assert.java:88) > at org.junit.Assert.failNotEquals(Assert.java:743) > at org.junit.Assert.assertEquals(Assert.java:118) > at org.junit.Assert.assertEquals(Assert.java:555) > at > org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.TestFairSchedulerPreemption.verifyPreemption(TestFairSchedulerPreemption.java:282) > at > org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.TestFairSchedulerPreemption.testPreemptionBetweenNonSiblingQueues(TestFairSchedulerPreemption.java:323) > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: yarn-issues-h...@hadoop.apache.org