Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-14533

Size of args cannot be less than zero in TraceAdmin#run as its linkedlist

    Details

    • Hadoop Flags:
      Reviewed

      Description

        @Override
        public int run(String argv[]) throws Exception {
            LinkedList<String> args = new LinkedList<String>();
            ……
               if (args.size() < 0) {
                  System.err.println("You must specify an operation.");
                       return 1;
              }
      ……
      }
      

      From the code above, the args is a linklist obejct, so it cannot be less than zero.meaning that code below is wrong

       if (args.size() < 0) {
            System.err.println("You must specify an operation.");
            return 1;
          }
      
      1. HADOOP-14533-001.patch
        2 kB
        Weisen Han
      2. HADOOP-14533-002.patch
        2 kB
        Weisen Han

        Activity

        Hide
        Weisen Han Weisen Han added a comment -

        Owen O'Malley can you assign this to me ?

        Show
        Weisen Han Weisen Han added a comment - Owen O'Malley can you assign this to me ?
        Hide
        jojochuang Wei-Chiu Chuang added a comment -

        Weisen Han thanks for reporting the issue. I've just added you as a contributor so feel free to assign this jira to yourself and post a patch.

        Show
        jojochuang Wei-Chiu Chuang added a comment - Weisen Han thanks for reporting the issue. I've just added you as a contributor so feel free to assign this jira to yourself and post a patch.
        Hide
        Weisen Han Weisen Han added a comment -

        Wei-Che Wei submit the patch, could you give me a code review?

        Show
        Weisen Han Weisen Han added a comment - Wei-Che Wei submit the patch, could you give me a code review?
        Hide
        jojochuang Wei-Chiu Chuang added a comment - - edited

        Good catch and thanks for posting the patch.
        +1 pending Jenkins.

        Show
        jojochuang Wei-Chiu Chuang added a comment - - edited Good catch and thanks for posting the patch. +1 pending Jenkins.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 17s 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.
        0 mvndep 1m 54s Maven dependency ordering for branch
        +1 mvninstall 14m 13s trunk passed
        +1 compile 14m 49s trunk passed
        +1 checkstyle 2m 4s trunk passed
        +1 mvnsite 2m 16s trunk passed
        -1 findbugs 1m 35s hadoop-common-project/hadoop-common in trunk has 19 extant Findbugs warnings.
        +1 javadoc 1m 45s trunk passed
        0 mvndep 0m 17s Maven dependency ordering for patch
        +1 mvninstall 1m 38s the patch passed
        +1 compile 12m 1s the patch passed
        +1 javac 12m 1s the patch passed
        +1 checkstyle 2m 0s the patch passed
        +1 mvnsite 2m 13s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 41s hadoop-common-project/hadoop-common generated 0 new + 18 unchanged - 1 fixed = 18 total (was 19)
        +1 findbugs 2m 7s hadoop-hdfs in the patch passed.
        +1 javadoc 1m 51s the patch passed
        +1 unit 8m 50s hadoop-common in the patch passed.
        -1 unit 95m 33s hadoop-hdfs in the patch failed.
        +1 asflicense 0m 38s The patch does not generate ASF License warnings.
        191m 16s



        Reason Tests
        Failed junit tests hadoop.hdfs.TestDFSStripedInputStreamWithRandomECPolicy
          hadoop.hdfs.TestDFSStripedOutputStreamWithFailure140
          hadoop.hdfs.TestDFSStripedOutputStreamWithFailure160
          hadoop.hdfs.server.blockmanagement.TestReconstructStripedBlocksWithRackAwareness
          hadoop.hdfs.TestRollingUpgrade
          hadoop.hdfs.server.namenode.snapshot.TestSnapshotFileLength
          hadoop.hdfs.TestDFSStripedOutputStreamWithFailure080
          hadoop.hdfs.server.datanode.TestDataNodeVolumeFailureReporting
        Timed out junit tests org.apache.hadoop.hdfs.TestLeaseRecovery2



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:14b5c93
        JIRA Issue HADOOP-14533
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12873304/HADOOP-14533-001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 99a9210e64c8 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 942ecbb
        Default Java 1.8.0_131
        findbugs v3.1.0-RC1
        findbugs https://builds.apache.org/job/PreCommit-HADOOP-Build/12547/artifact/patchprocess/branch-findbugs-hadoop-common-project_hadoop-common-warnings.html
        unit https://builds.apache.org/job/PreCommit-HADOOP-Build/12547/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/12547/testReport/
        modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs U: .
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/12547/console
        Powered by Apache Yetus 0.5.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 17s 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. 0 mvndep 1m 54s Maven dependency ordering for branch +1 mvninstall 14m 13s trunk passed +1 compile 14m 49s trunk passed +1 checkstyle 2m 4s trunk passed +1 mvnsite 2m 16s trunk passed -1 findbugs 1m 35s hadoop-common-project/hadoop-common in trunk has 19 extant Findbugs warnings. +1 javadoc 1m 45s trunk passed 0 mvndep 0m 17s Maven dependency ordering for patch +1 mvninstall 1m 38s the patch passed +1 compile 12m 1s the patch passed +1 javac 12m 1s the patch passed +1 checkstyle 2m 0s the patch passed +1 mvnsite 2m 13s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 41s hadoop-common-project/hadoop-common generated 0 new + 18 unchanged - 1 fixed = 18 total (was 19) +1 findbugs 2m 7s hadoop-hdfs in the patch passed. +1 javadoc 1m 51s the patch passed +1 unit 8m 50s hadoop-common in the patch passed. -1 unit 95m 33s hadoop-hdfs in the patch failed. +1 asflicense 0m 38s The patch does not generate ASF License warnings. 191m 16s Reason Tests Failed junit tests hadoop.hdfs.TestDFSStripedInputStreamWithRandomECPolicy   hadoop.hdfs.TestDFSStripedOutputStreamWithFailure140   hadoop.hdfs.TestDFSStripedOutputStreamWithFailure160   hadoop.hdfs.server.blockmanagement.TestReconstructStripedBlocksWithRackAwareness   hadoop.hdfs.TestRollingUpgrade   hadoop.hdfs.server.namenode.snapshot.TestSnapshotFileLength   hadoop.hdfs.TestDFSStripedOutputStreamWithFailure080   hadoop.hdfs.server.datanode.TestDataNodeVolumeFailureReporting Timed out junit tests org.apache.hadoop.hdfs.TestLeaseRecovery2 Subsystem Report/Notes Docker Image:yetus/hadoop:14b5c93 JIRA Issue HADOOP-14533 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12873304/HADOOP-14533-001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 99a9210e64c8 3.13.0-107-generic #154-Ubuntu SMP Tue Dec 20 09:57:27 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 942ecbb Default Java 1.8.0_131 findbugs v3.1.0-RC1 findbugs https://builds.apache.org/job/PreCommit-HADOOP-Build/12547/artifact/patchprocess/branch-findbugs-hadoop-common-project_hadoop-common-warnings.html unit https://builds.apache.org/job/PreCommit-HADOOP-Build/12547/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/12547/testReport/ modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs U: . Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/12547/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        Weisen Han Weisen Han added a comment -

        None of the findbug warning and junit test failing is related with this patch.

        Show
        Weisen Han Weisen Han added a comment - None of the findbug warning and junit test failing is related with this patch.
        Hide
        vagarychen Chen Liang added a comment -

        Thanks Weisen Han for reporting this! A minor comment though, I believe isEmpty() is slightly more favorable than == 0 performance-wise.

        Show
        vagarychen Chen Liang added a comment - Thanks Weisen Han for reporting this! A minor comment though, I believe isEmpty() is slightly more favorable than == 0 performance-wise.
        Hide
        Weisen Han Weisen Han added a comment -

        Thanks for your review, Chen Liang.
        submit the patch as you suggested.

        Show
        Weisen Han Weisen Han added a comment - Thanks for your review, Chen Liang . submit the patch as you suggested.
        Hide
        Hongyuan Li Hongyuan Li added a comment -

        Seems this exists since 2.6.0

        Show
        Hongyuan Li Hongyuan Li added a comment - Seems this exists since 2.6.0
        Hide
        brahmareddy Brahma Reddy Battula added a comment -

        I believe isEmpty() is slightly more favorable than == 0 performance-wise.

        Good suggestion, +1 on latest patch.. Pending for jenkins.

        Show
        brahmareddy Brahma Reddy Battula added a comment - I believe isEmpty() is slightly more favorable than == 0 performance-wise. Good suggestion, +1 on latest patch.. Pending for jenkins.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 21s 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.
        0 mvndep 1m 25s Maven dependency ordering for branch
        +1 mvninstall 18m 49s trunk passed
        +1 compile 20m 43s trunk passed
        +1 checkstyle 2m 25s trunk passed
        +1 mvnsite 2m 57s trunk passed
        -1 findbugs 1m 59s hadoop-common-project/hadoop-common in trunk has 19 extant Findbugs warnings.
        +1 javadoc 2m 8s trunk passed
        0 mvndep 0m 20s Maven dependency ordering for patch
        +1 mvninstall 2m 13s the patch passed
        +1 compile 15m 49s the patch passed
        +1 javac 15m 49s the patch passed
        +1 checkstyle 2m 19s the patch passed
        +1 mvnsite 2m 54s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 2m 17s hadoop-common-project/hadoop-common generated 0 new + 18 unchanged - 1 fixed = 18 total (was 19)
        +1 findbugs 2m 39s hadoop-hdfs in the patch passed.
        +1 javadoc 2m 12s the patch passed
        +1 unit 10m 41s hadoop-common in the patch passed.
        -1 unit 97m 38s hadoop-hdfs in the patch failed.
        +1 asflicense 0m 42s The patch does not generate ASF License warnings.
        214m 23s



        Reason Tests
        Failed junit tests hadoop.hdfs.TestDFSStripedOutputStreamWithFailure080
          hadoop.hdfs.server.namenode.TestFileTruncate
          hadoop.hdfs.server.namenode.TestUpgradeDomainBlockPlacementPolicy
          hadoop.hdfs.server.namenode.TestFsck
          hadoop.hdfs.server.datanode.TestDataNodeVolumeFailureReporting
          hadoop.hdfs.web.TestWebHdfsTimeouts



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:14b5c93
        JIRA Issue HADOOP-14533
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12873590/HADOOP-14533-002.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 8f3a208f3921 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
        Build tool maven
        Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh
        git revision trunk / 3369540
        Default Java 1.8.0_131
        findbugs v3.1.0-RC1
        findbugs https://builds.apache.org/job/PreCommit-HADOOP-Build/12573/artifact/patchprocess/branch-findbugs-hadoop-common-project_hadoop-common-warnings.html
        unit https://builds.apache.org/job/PreCommit-HADOOP-Build/12573/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt
        Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/12573/testReport/
        modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs U: .
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/12573/console
        Powered by Apache Yetus 0.5.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 21s 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. 0 mvndep 1m 25s Maven dependency ordering for branch +1 mvninstall 18m 49s trunk passed +1 compile 20m 43s trunk passed +1 checkstyle 2m 25s trunk passed +1 mvnsite 2m 57s trunk passed -1 findbugs 1m 59s hadoop-common-project/hadoop-common in trunk has 19 extant Findbugs warnings. +1 javadoc 2m 8s trunk passed 0 mvndep 0m 20s Maven dependency ordering for patch +1 mvninstall 2m 13s the patch passed +1 compile 15m 49s the patch passed +1 javac 15m 49s the patch passed +1 checkstyle 2m 19s the patch passed +1 mvnsite 2m 54s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 2m 17s hadoop-common-project/hadoop-common generated 0 new + 18 unchanged - 1 fixed = 18 total (was 19) +1 findbugs 2m 39s hadoop-hdfs in the patch passed. +1 javadoc 2m 12s the patch passed +1 unit 10m 41s hadoop-common in the patch passed. -1 unit 97m 38s hadoop-hdfs in the patch failed. +1 asflicense 0m 42s The patch does not generate ASF License warnings. 214m 23s Reason Tests Failed junit tests hadoop.hdfs.TestDFSStripedOutputStreamWithFailure080   hadoop.hdfs.server.namenode.TestFileTruncate   hadoop.hdfs.server.namenode.TestUpgradeDomainBlockPlacementPolicy   hadoop.hdfs.server.namenode.TestFsck   hadoop.hdfs.server.datanode.TestDataNodeVolumeFailureReporting   hadoop.hdfs.web.TestWebHdfsTimeouts Subsystem Report/Notes Docker Image:yetus/hadoop:14b5c93 JIRA Issue HADOOP-14533 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12873590/HADOOP-14533-002.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 8f3a208f3921 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Build tool maven Personality /testptch/hadoop/patchprocess/precommit/personality/provided.sh git revision trunk / 3369540 Default Java 1.8.0_131 findbugs v3.1.0-RC1 findbugs https://builds.apache.org/job/PreCommit-HADOOP-Build/12573/artifact/patchprocess/branch-findbugs-hadoop-common-project_hadoop-common-warnings.html unit https://builds.apache.org/job/PreCommit-HADOOP-Build/12573/artifact/patchprocess/patch-unit-hadoop-hdfs-project_hadoop-hdfs.txt Test Results https://builds.apache.org/job/PreCommit-HADOOP-Build/12573/testReport/ modules C: hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs U: . Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/12573/console Powered by Apache Yetus 0.5.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        brahmareddy Brahma Reddy Battula added a comment -

        Committed to trunk,branch-2 and branch-2.8. Weisen Han thanks for reporting and contributing this.
        thanks to Wei-Chiu Chuang and Chen Liang for additional review.

        Show
        brahmareddy Brahma Reddy Battula added a comment - Committed to trunk , branch-2 and branch-2.8 . Weisen Han thanks for reporting and contributing this. thanks to Wei-Chiu Chuang and Chen Liang for additional review.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11893 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11893/)
        HADOOP-14533. Size of args cannot be less than zero in TraceAdmin#run as (brahma: rev 2e9daa2e27536484846d9c5f020c6afaf27932ce)

        • (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceAdmin.java
        • (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #11893 (See https://builds.apache.org/job/Hadoop-trunk-Commit/11893/ ) HADOOP-14533 . Size of args cannot be less than zero in TraceAdmin#run as (brahma: rev 2e9daa2e27536484846d9c5f020c6afaf27932ce) (edit) hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/tracing/TraceAdmin.java (edit) hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/tracing/TestTraceAdmin.java
        Hide
        Weisen Han Weisen Han added a comment -

        thanks to Wei-Chiu Chuang and Chen Liang for your review. Thanks to Brahma Reddy Battula for your review and commit.

        Show
        Weisen Han Weisen Han added a comment - thanks to Wei-Chiu Chuang and Chen Liang for your review. Thanks to Brahma Reddy Battula for your review and commit.

          People

          • Assignee:
            Weisen Han Weisen Han
            Reporter:
            Weisen Han Weisen Han
          • Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development