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

Reuse closeResponder to reset the response variable in DataStreamer#run

    Details

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

      Description

      When worked for HDFS-6532, I found that the error recovery will happens when responder close fails. The related codes:

      {code:title=DataStreamer.java|borderStyle=solid}
        public void run() {
          long lastPacket = Time.monotonicNow();
          TraceScope scope = null;
          while (!streamerClosed && dfsClient.clientRunning) {
            // if the Responder encountered an error, shutdown Responder
            if (errorState.hasError() && response != null) {
              try {
                response.close();
                response.join();
                response = null;
              } catch (InterruptedException e) {
                // If interruptedException happens, the response will not be set to null
                // and that will lead the error recovry.
                LOG.warn("Caught exception", e);
              }
            }
            // Here need add a finally block to set response as null
            ...
      

      Can see the related comment:https://issues.apache.org/jira/browse/HDFS-6532?focusedCommentId=15448770&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15448770

      1. HDFS-10820.002.patch
        1.0 kB
        Yiqun Lin
      2. HDFS-10820.001.patch
        0.9 kB
        Yiqun Lin

        Activity

        Hide
        linyiqun Yiqun Lin added a comment - - edited

        Attach a simple patch for fixing this. According to the comment from Xiao Chen , I reuse the method closeResponder here.

        Show
        linyiqun Yiqun Lin added a comment - - edited Attach a simple patch for fixing this. According to the comment from Xiao Chen , I reuse the method closeResponder here.
        Hide
        hadoopqa Hadoop QA added a comment -
        -1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 16s Docker mode activated.
        +1 @author 0m 0s The patch does not contain any @author tags.
        -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 6m 57s trunk passed
        +1 compile 0m 30s trunk passed
        +1 checkstyle 0m 16s trunk passed
        +1 mvnsite 0m 33s trunk passed
        +1 mvneclipse 0m 12s trunk passed
        +1 findbugs 1m 24s trunk passed
        +1 javadoc 0m 20s trunk passed
        +1 mvninstall 0m 29s the patch passed
        +1 compile 0m 27s the patch passed
        +1 javac 0m 27s the patch passed
        -0 checkstyle 0m 12s hadoop-hdfs-project/hadoop-hdfs-client: The patch generated 1 new + 77 unchanged - 1 fixed = 78 total (was 78)
        +1 mvnsite 0m 31s the patch passed
        +1 mvneclipse 0m 9s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 30s the patch passed
        +1 javadoc 0m 16s the patch passed
        +1 unit 0m 53s hadoop-hdfs-client in the patch passed.
        +1 asflicense 0m 16s The patch does not generate ASF License warnings.
        16m 29s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue HDFS-10820
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12826298/HDFS-10820.001.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux 26dddc6a4505 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 / 20ae1fa
        Default Java 1.8.0_101
        findbugs v3.0.0
        checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16587/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-client.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16587/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16587/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 16s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 6m 57s trunk passed +1 compile 0m 30s trunk passed +1 checkstyle 0m 16s trunk passed +1 mvnsite 0m 33s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 24s trunk passed +1 javadoc 0m 20s trunk passed +1 mvninstall 0m 29s the patch passed +1 compile 0m 27s the patch passed +1 javac 0m 27s the patch passed -0 checkstyle 0m 12s hadoop-hdfs-project/hadoop-hdfs-client: The patch generated 1 new + 77 unchanged - 1 fixed = 78 total (was 78) +1 mvnsite 0m 31s the patch passed +1 mvneclipse 0m 9s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 30s the patch passed +1 javadoc 0m 16s the patch passed +1 unit 0m 53s hadoop-hdfs-client in the patch passed. +1 asflicense 0m 16s The patch does not generate ASF License warnings. 16m 29s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10820 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12826298/HDFS-10820.001.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux 26dddc6a4505 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 / 20ae1fa Default Java 1.8.0_101 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16587/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-client.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16587/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16587/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        xiaochen Xiao Chen added a comment -

        This is a trivial refactor, so no test needed. Error from checkstyle already exists, and is only improved by this.

        Only a super trivial comment, since we're checking nullity in closeResponder, we could remove that from the if clause errorState.hasError() && response != null. +1 pending this.

        Thanks for working on this, Yiqun Lin.

        Show
        xiaochen Xiao Chen added a comment - This is a trivial refactor, so no test needed. Error from checkstyle already exists, and is only improved by this. Only a super trivial comment, since we're checking nullity in closeResponder , we could remove that from the if clause errorState.hasError() && response != null . +1 pending this. Thanks for working on this, Yiqun Lin .
        Hide
        linyiqun Yiqun Lin added a comment -

        Good catch, thanks Xiao Chen for the quick review! Attach a new patch for addressing your comment.

        Show
        linyiqun Yiqun Lin added a comment - Good catch, thanks Xiao Chen for the quick review! Attach a new patch for addressing your comment.
        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 doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
        +1 mvninstall 7m 43s trunk passed
        +1 compile 0m 30s trunk passed
        +1 checkstyle 0m 15s trunk passed
        +1 mvnsite 0m 34s trunk passed
        +1 mvneclipse 0m 12s trunk passed
        +1 findbugs 1m 25s trunk passed
        +1 javadoc 0m 20s trunk passed
        +1 mvninstall 0m 31s the patch passed
        +1 compile 0m 28s the patch passed
        +1 javac 0m 28s the patch passed
        -0 checkstyle 0m 12s hadoop-hdfs-project/hadoop-hdfs-client: The patch generated 1 new + 77 unchanged - 1 fixed = 78 total (was 78)
        +1 mvnsite 0m 29s the patch passed
        +1 mvneclipse 0m 9s the patch passed
        +1 whitespace 0m 0s The patch has no whitespace issues.
        +1 findbugs 1m 29s the patch passed
        +1 javadoc 0m 17s the patch passed
        +1 unit 0m 54s hadoop-hdfs-client in the patch passed.
        +1 asflicense 0m 15s The patch does not generate ASF License warnings.
        17m 17s



        Subsystem Report/Notes
        Docker Image:yetus/hadoop:9560f25
        JIRA Issue HDFS-10820
        JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12826331/HDFS-10820.002.patch
        Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle
        uname Linux d0e6de402250 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 / 20ae1fa
        Default Java 1.8.0_101
        findbugs v3.0.0
        checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16590/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-client.txt
        Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16590/testReport/
        modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16590/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 21s Docker mode activated. +1 @author 0m 0s The patch does not contain any @author tags. -1 test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 mvninstall 7m 43s trunk passed +1 compile 0m 30s trunk passed +1 checkstyle 0m 15s trunk passed +1 mvnsite 0m 34s trunk passed +1 mvneclipse 0m 12s trunk passed +1 findbugs 1m 25s trunk passed +1 javadoc 0m 20s trunk passed +1 mvninstall 0m 31s the patch passed +1 compile 0m 28s the patch passed +1 javac 0m 28s the patch passed -0 checkstyle 0m 12s hadoop-hdfs-project/hadoop-hdfs-client: The patch generated 1 new + 77 unchanged - 1 fixed = 78 total (was 78) +1 mvnsite 0m 29s the patch passed +1 mvneclipse 0m 9s the patch passed +1 whitespace 0m 0s The patch has no whitespace issues. +1 findbugs 1m 29s the patch passed +1 javadoc 0m 17s the patch passed +1 unit 0m 54s hadoop-hdfs-client in the patch passed. +1 asflicense 0m 15s The patch does not generate ASF License warnings. 17m 17s Subsystem Report/Notes Docker Image:yetus/hadoop:9560f25 JIRA Issue HDFS-10820 JIRA Patch URL https://issues.apache.org/jira/secure/attachment/12826331/HDFS-10820.002.patch Optional Tests asflicense compile javac javadoc mvninstall mvnsite unit findbugs checkstyle uname Linux d0e6de402250 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 / 20ae1fa Default Java 1.8.0_101 findbugs v3.0.0 checkstyle https://builds.apache.org/job/PreCommit-HDFS-Build/16590/artifact/patchprocess/diff-checkstyle-hadoop-hdfs-project_hadoop-hdfs-client.txt Test Results https://builds.apache.org/job/PreCommit-HDFS-Build/16590/testReport/ modules C: hadoop-hdfs-project/hadoop-hdfs-client U: hadoop-hdfs-project/hadoop-hdfs-client Console output https://builds.apache.org/job/PreCommit-HDFS-Build/16590/console Powered by Apache Yetus 0.4.0-SNAPSHOT http://yetus.apache.org This message was automatically generated.
        Hide
        xiaochen Xiao Chen added a comment - - edited

        +1, will commit after 24 hours. (I edited the title to be more specific, feel free to let me know if you want it otherwise)

        Show
        xiaochen Xiao Chen added a comment - - edited +1, will commit after 24 hours. (I edited the title to be more specific, feel free to let me know if you want it otherwise)
        Hide
        xiaochen Xiao Chen added a comment - - edited

        I have committed this to trunk. Thanks Yiqun Lin] for the contribution.

        Show
        xiaochen Xiao Chen added a comment - - edited I have committed this to trunk. Thanks Yiqun Lin ] for the contribution.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10388 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10388/)
        HDFS-10820. Reuse closeResponder to reset the response variable in (xiao: rev 0690f0969efef201b074a8b26400b2e5ba9b97ad)

        • (edit) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Hadoop-trunk-Commit #10388 (See https://builds.apache.org/job/Hadoop-trunk-Commit/10388/ ) HDFS-10820 . Reuse closeResponder to reset the response variable in (xiao: rev 0690f0969efef201b074a8b26400b2e5ba9b97ad) (edit) hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DataStreamer.java
        Hide
        linyiqun Yiqun Lin added a comment -

        Thanks for the commit, Xiao!

        Show
        linyiqun Yiqun Lin added a comment - Thanks for the commit, Xiao!

          People

          • Assignee:
            linyiqun Yiqun Lin
            Reporter:
            linyiqun Yiqun Lin
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development