Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-7270

Fix unsafe casting from long to int for class Resource and its sub-classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 2.9.0, 3.0.0, 3.1.0
    • resourcemanager
    • None
    • Reviewed

    Description

      Class Resource has three sub classes(FixedValueResource, LightWeightResource, and ResourcePBImpl). Only FixedValueResource handle long-to-int casting nicely. The other two didn't. This bug is introduced by resource type feature and causes several unit test failures. For example:

      Error Message
      
      expected:<<memory:4096, vCores:4>> but was:<<memory:4096, vCores:-1>>
      Stacktrace
      
      java.lang.AssertionError: expected:<<memory:4096, vCores:4>> but was:<<memory:4096, vCores:-1>>
      	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:144)
      	at org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.TestFSAppAttempt.testHeadroomWithBlackListedNodes(TestFSAppAttempt.java:325)
      

      Attachments

        1. YARN-7270.001.patch
          6 kB
          Yufei Gu
        2. YARN-7270.002.patch
          6 kB
          Yufei Gu
        3. YARN-7270.003.patch
          8 kB
          Yufei Gu
        4. YARN-7270.004.patch
          8 kB
          Yufei Gu
        5. YARN-7270.005.patch
          8 kB
          Yufei Gu
        6. YARN-7270.branch-3.0.addendum.001.patch
          3 kB
          Daniel Templeton
        7. YARN-7270.branch-3.0.patch
          4 kB
          Yufei Gu

        Issue Links

          Activity

            People

              yufeigu Yufei Gu
              yufeigu Yufei Gu
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: