Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10915

Fix time measurement bug in TestDatanodeRestart#testWaitForRegistrationOnRestart

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.4, 3.0.0-alpha2
    • Component/s: test
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      It should be milliseconds in the message of IOException.

      } catch (org.apache.hadoop.ipc.RemoteException e) {
              long elapsed = System.currentTimeMillis() - start;
              // timers have at-least semantics, so it should be at least 5 seconds.
              if (elapsed < 5000 || elapsed > 10000) {
                throw new IOException(elapsed + " seconds passed.", e);
              }
            }
      
      1. HDFS-10915.000.patch
        2 kB
        Xiaobing Zhou
      2. HDFS-10915.001.patch
        3 kB
        Xiaobing Zhou

        Activity

        Hide
        xiaobingo Xiaobing Zhou added a comment -

        Thank you Mingliang Liu for committing it.

        Show
        xiaobingo Xiaobing Zhou added a comment - Thank you Mingliang Liu for committing it.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10504 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10504/)
        HDFS-10915. Fix time measurement bug in TestDatanodeRestart. Contributed (liuml07: rev 6437ba18c5c26bc271a63aff5ea03756f43dd9a3)

        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestDatanodeRestart.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10504 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10504/ ) HDFS-10915 . Fix time measurement bug in TestDatanodeRestart. Contributed (liuml07: rev 6437ba18c5c26bc271a63aff5ea03756f43dd9a3) (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestDatanodeRestart.java
        Hide
        liuml07 Mingliang Liu added a comment -

        Committed to trunk through branch-2.7. Thanks for the contribution, Xiaobing Zhou.

        Show
        liuml07 Mingliang Liu added a comment - Committed to trunk through branch-2.7 . Thanks for the contribution, Xiaobing Zhou .
        Hide
        hadoopqa Hadoop QA added a comment -
        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 18s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        +1 mvninstall 7m 44s trunk passed
        +1 compile 0m 53s trunk passed
        +1 checkstyle 0m 29s trunk passed
        +1 mvnsite 0m 59s trunk passed
        +1 mvneclipse 0m 12s trunk passed
        +1 findbugs 1m 48s trunk passed
        +1 javadoc 1m 0s trunk passed
        +1 mvninstall 0m 54s the patch passed
        +1 compile 0m 53s the patch passed
        +1 javac 0m 53s the patch passed
        +1 checkstyle 0m 24s the patch passed
        +1 mvnsite 0m 59s the patch passed
        +1 mvneclipse 0m 10s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 59s the patch passed
        +1 javadoc 1m 1s the patch passed
        +1 unit 65m 10s hadoop-hdfs in the patch passed.
        +1 asflicense 0m 20s The patch does not generate ASF License warnings.
        86m 31s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue HDFS-10915
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830609/HDFS-10915.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux d4da7700de37 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / d144398
        Default Java 1.8.0_101
        findbugs v3.0.0
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16893/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16893/console
        Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 reexec 0m 18s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 44s trunk passed +1 compile 0m 53s trunk passed +1 checkstyle 0m 29s trunk passed +1 mvnsite 0m 59s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 48s trunk passed +1 javadoc 1m 0s trunk passed +1 mvninstall 0m 54s the patch passed +1 compile 0m 53s the patch passed +1 javac 0m 53s the patch passed +1 checkstyle 0m 24s the patch passed +1 mvnsite 0m 59s the patch passed +1 mvneclipse 0m 10s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 59s the patch passed +1 javadoc 1m 1s the patch passed +1 unit 65m 10s hadoop-hdfs in the patch passed. +1 asflicense 0m 20s The patch does not generate ASF License warnings. 86m 31s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10915 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830609/HDFS-10915.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux d4da7700de37 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / d144398 Default Java 1.8.0_101 findbugs v3.0.0 Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16893/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16893/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        liuml07 Mingliang Liu added a comment -

        +1 pending on Jenkins.

        Show
        liuml07 Mingliang Liu added a comment - +1 pending on Jenkins.
        Hide
        xiaobingo Xiaobing Zhou added a comment -

        Thanks Mingliang Liu, quite good input. I posted v001 patch for that.

        Show
        xiaobingo Xiaobing Zhou added a comment - Thanks Mingliang Liu , quite good input. I posted v001 patch for that.
        Hide
        liuml07 Mingliang Liu added a comment -

        Thanks for the patch.

        Can you also replace the code that uses System.currentTimeMillis() with System.nanoTime().

        The reason is that the granularity of System.currentTimeMillis() depends on the implementation and on the OS and is usually around 10 ms (up to 100ms on some platforms). Instead, System.nanoTime() returns the current value of the most precise available system timer (in nanoseconds). The latter is perfect to calculate elapsed time. Specially, in Hadoop, we can use org.apache.hadoop.util#monotonicNow() for getting the start/end time.

        Show
        liuml07 Mingliang Liu added a comment - Thanks for the patch. Can you also replace the code that uses System.currentTimeMillis() with System.nanoTime() . The reason is that the granularity of System.currentTimeMillis() depends on the implementation and on the OS and is usually around 10 ms (up to 100ms on some platforms). Instead, System.nanoTime() returns the current value of the most precise available system timer (in nanoseconds). The latter is perfect to calculate elapsed time. Specially, in Hadoop, we can use org.apache.hadoop.util#monotonicNow() for getting the start/end time.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 15s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 test4tests 0m 0s The patch appears to include 1 new or modified test files.
        +1 mvninstall 7m 10s trunk passed
        +1 compile 0m 53s trunk passed
        +1 checkstyle 0m 28s trunk passed
        +1 mvnsite 1m 0s trunk passed
        +1 mvneclipse 0m 13s trunk passed
        +1 findbugs 1m 58s trunk passed
        +1 javadoc 1m 1s trunk passed
        +1 mvninstall 0m 55s the patch passed
        +1 compile 0m 49s the patch passed
        +1 javac 0m 49s the patch passed
        +1 checkstyle 0m 25s the patch passed
        +1 mvnsite 1m 0s the patch passed
        +1 mvneclipse 0m 11s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 2m 5s the patch passed
        +1 javadoc 0m 59s the patch passed
        -1 unit 62m 7s hadoop-hdfs in the patch failed.
        +1 asflicense 0m 18s The patch does not generate ASF License warnings.
        83m 9s



        Reason Tests
        Failed junit tests hadoop.hdfs.server.blockmanagement.TestPendingInvalidateBlock



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue HDFS-10915
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830584/HDFS-10915.000.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux ffb6991bbd4a 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 2acfb1e
        Default Java 1.8.0_101
        findbugs v3.0.0
        unit https://builds.apache.org/job/PreCommit-HDFS-Build/16887/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16887/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16887/console
        Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment 0 reexec 0m 15s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. +1 test4tests 0m 0s The patch appears to include 1 new or modified test files. +1 mvninstall 7m 10s trunk passed +1 compile 0m 53s trunk passed +1 checkstyle 0m 28s trunk passed +1 mvnsite 1m 0s trunk passed +1 mvneclipse 0m 13s trunk passed +1 findbugs 1m 58s trunk passed +1 javadoc 1m 1s trunk passed +1 mvninstall 0m 55s the patch passed +1 compile 0m 49s the patch passed +1 javac 0m 49s the patch passed +1 checkstyle 0m 25s the patch passed +1 mvnsite 1m 0s the patch passed +1 mvneclipse 0m 11s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 2m 5s the patch passed +1 javadoc 0m 59s the patch passed -1 unit 62m 7s hadoop-hdfs in the patch failed. +1 asflicense 0m 18s The patch does not generate ASF License warnings. 83m 9s Reason Tests Failed junit tests hadoop.hdfs.server.blockmanagement.TestPendingInvalidateBlock Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10915 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12830584/HDFS-10915.000.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux ffb6991bbd4a 3.13.0-93-generic #140-Ubuntu SMP Mon Jul 18 21:21:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 2acfb1e Default Java 1.8.0_101 findbugs v3.0.0 unit https://builds.apache.org/job/PreCommit-HDFS-Build/16887/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16887/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs U: hadoop-hdfs-project/hadoop-hdfs Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16887/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        xiaobingo Xiaobing Zhou added a comment -

        v000 is posted, please kindly review it, thanks.

        Show
        xiaobingo Xiaobing Zhou added a comment - v000 is posted, please kindly review it, thanks.

          People

          • Assignee:
            xiaobingo Xiaobing Zhou
            Reporter:
            xiaobingo Xiaobing Zhou
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development