Details

      Description

      The standby RM's webui tries to do a redirect via meta-refresh. That is fine for pages designed to be viewed by web browsers. But the API endpoints shouldn't do that. Most programmatic HTTP clients do not do meta-refresh. I'd suggest HTTP 303, or return a well-defined error message (json or xml) stating that the standby status and a link to the active RM.

      The standby RM is returning this today:

      $ curl -i http://bcsec-1.ent.cloudera.com:8088/ws/v1/cluster/metrics
      HTTP/1.1 200 OK
      Cache-Control: no-cache
      Expires: Thu, 25 Sep 2014 18:34:53 GMT
      Date: Thu, 25 Sep 2014 18:34:53 GMT
      Pragma: no-cache
      Expires: Thu, 25 Sep 2014 18:34:53 GMT
      Date: Thu, 25 Sep 2014 18:34:53 GMT
      Pragma: no-cache
      Content-Type: text/plain; charset=UTF-8
      Refresh: 3; url=http://bcsec-2.ent.cloudera.com:8088/ws/v1/cluster/metrics
      Content-Length: 117
      Server: Jetty(6.1.26)
      
      This is standby RM. Redirecting to the current active RM: http://bcsec-2.ent.cloudera.com:8088/ws/v1/cluster/metrics
      
      1. YARN-2605.1.patch
        2 kB
        Xuan Gong
      2. YARN-2605.2.patch
        2 kB
        Xuan Gong

        Issue Links

          Activity

          Hide
          stevel@apache.org Steve Loughran added a comment -

          Can it just send a 307 "resubmit same verb" response to the caller? That will be picked up by browsers and handled as a new GET, while REST clients (including curl, jersey, htttpclient) will either GET or resubmit the original verb depending on their config.

          Sending a custom structured response won't work with those existing clients

          Show
          stevel@apache.org Steve Loughran added a comment - Can it just send a 307 "resubmit same verb" response to the caller? That will be picked up by browsers and handled as a new GET, while REST clients (including curl, jersey, htttpclient) will either GET or resubmit the original verb depending on their config. Sending a custom structured response won't work with those existing clients
          Hide
          xgong Xuan Gong added a comment -

          Anubhav Dhoot Feel free to assign back to yourself, if you have already worked on this ticket.

          Steve Loughran Please take a look.

          Removed the refresh header, add the location header to hold the redirect url, and set status as 307.

          $ curl -i http://127.0.0.1:33188/ws/v1/cluster/metrics
          HTTP/1.1 307 TEMPORARY_REDIRECT
          Cache-Control: no-cache
          Expires: Thu, 16 Apr 2015 23:01:47 GMT
          Date: Thu, 16 Apr 2015 23:01:47 GMT
          Pragma: no-cache
          Expires: Thu, 16 Apr 2015 23:01:47 GMT
          Date: Thu, 16 Apr 2015 23:01:47 GMT
          Pragma: no-cache
          Content-Type: text/plain; charset=UTF-8
          Location: http://localhost:23188/ws/v1/cluster/metrics
          Content-Length: 84
          Server: Jetty(6.1.26)
          
          This is standby RM. The redirect url ishttp://localhost:23188/ws/v1/cluster/metrics
          

          If i do

          $ curl -i -L http://127.0.0.1:33188/ws/v1/cluster/metrics
          

          , it will redirect to the active rm and get the metrics.

          Show
          xgong Xuan Gong added a comment - Anubhav Dhoot Feel free to assign back to yourself, if you have already worked on this ticket. Steve Loughran Please take a look. Removed the refresh header, add the location header to hold the redirect url, and set status as 307. $ curl -i http: //127.0.0.1:33188/ws/v1/cluster/metrics HTTP/1.1 307 TEMPORARY_REDIRECT Cache-Control: no-cache Expires: Thu, 16 Apr 2015 23:01:47 GMT Date: Thu, 16 Apr 2015 23:01:47 GMT Pragma: no-cache Expires: Thu, 16 Apr 2015 23:01:47 GMT Date: Thu, 16 Apr 2015 23:01:47 GMT Pragma: no-cache Content-Type: text/plain; charset=UTF-8 Location: http: //localhost:23188/ws/v1/cluster/metrics Content-Length: 84 Server: Jetty(6.1.26) This is standby RM. The redirect url ishttp: //localhost:23188/ws/v1/cluster/metrics If i do $ curl -i -L http: //127.0.0.1:33188/ws/v1/cluster/metrics , it will redirect to the active rm and get the metrics.
          Hide
          hadoopqa Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12726001/YARN-2605.1.patch
          against trunk revision 4308910.

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 1 new or modified test files.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager.

          Test results: https://builds.apache.org/job/PreCommit-YARN-Build/7367//testReport/
          Console output: https://builds.apache.org/job/PreCommit-YARN-Build/7367//console

          This message is automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12726001/YARN-2605.1.patch against trunk revision 4308910. +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager. Test results: https://builds.apache.org/job/PreCommit-YARN-Build/7367//testReport/ Console output: https://builds.apache.org/job/PreCommit-YARN-Build/7367//console This message is automatically generated.
          Hide
          stevel@apache.org Steve Loughran added a comment -

          patch looks good in production; 307 is the error code rest apps need; these will ignore the text so that can stay human-readable.

          Why is a test now tagged as @ignore?

          Show
          stevel@apache.org Steve Loughran added a comment - patch looks good in production; 307 is the error code rest apps need; these will ignore the text so that can stay human-readable. Why is a test now tagged as @ignore?
          Hide
          xgong Xuan Gong added a comment -

          Thanks for the review. Steve Loughran

          Why is a test now tagged as @ignore?

          The testcase does not work at all if we made the changes. It gives me "too many redirect loops" exception.

          Show
          xgong Xuan Gong added a comment - Thanks for the review. Steve Loughran Why is a test now tagged as @ignore? The testcase does not work at all if we made the changes. It gives me "too many redirect loops" exception.
          Hide
          stevel@apache.org Steve Loughran added a comment -

          I worry about that testcase; it could be a sign of a problem ... we've seen a similar situation in Slider integration tests: both proxies redirecting to the other

          Show
          stevel@apache.org Steve Loughran added a comment - I worry about that testcase; it could be a sign of a problem ... we've seen a similar situation in Slider integration tests: both proxies redirecting to the other
          Hide
          xgong Xuan Gong added a comment -

          Uploaded a new patch, and verified in a single node HA cluster.

          Show
          xgong Xuan Gong added a comment - Uploaded a new patch, and verified in a single node HA cluster.
          Hide
          hadoopqa Hadoop QA added a comment -



          +1 overall



          Vote Subsystem Runtime Comment
          0 pre-patch 14m 40s Pre-patch trunk compilation is healthy.
          +1 @author 0m 0s The patch does not contain any @author tags.
          +1 tests included 0m 0s The patch appears to include 1 new or modified test files.
          +1 whitespace 0m 0s The patch has no lines that end in whitespace.
          +1 javac 7m 32s There were no new javac warning messages.
          +1 javadoc 9m 38s There were no new javadoc warning messages.
          +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings.
          +1 checkstyle 7m 40s There were no new checkstyle issues.
          +1 install 1m 35s mvn install still works.
          +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse.
          +1 findbugs 1m 59s The patch does not introduce any new Findbugs (version 2.0.3) warnings.
          +1 yarn tests 6m 57s Tests passed in hadoop-yarn-client.
          +1 yarn tests 52m 33s Tests passed in hadoop-yarn-server-resourcemanager.
              103m 32s  



          Subsystem Report/Notes
          Patch URL http://issues.apache.org/jira/secure/attachment/12727301/YARN-2605.2.patch
          Optional Tests javac unit findbugs checkstyle javadoc
          git revision trunk / 12f4df0
          hadoop-yarn-client test log https://builds.apache.org/job/PreCommit-YARN-Build/7452/artifact/patchprocess/testrun_hadoop-yarn-client.txt
          hadoop-yarn-server-resourcemanager test log https://builds.apache.org/job/PreCommit-YARN-Build/7452/artifact/patchprocess/testrun_hadoop-yarn-server-resourcemanager.txt
          Test Results https://builds.apache.org/job/PreCommit-YARN-Build/7452/testReport/
          Console output https://builds.apache.org/job/PreCommit-YARN-Build/7452//console

          This message was automatically generated.

          Show
          hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 pre-patch 14m 40s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. +1 tests included 0m 0s The patch appears to include 1 new or modified test files. +1 whitespace 0m 0s The patch has no lines that end in whitespace. +1 javac 7m 32s There were no new javac warning messages. +1 javadoc 9m 38s There were no new javadoc warning messages. +1 release audit 0m 22s The applied patch does not increase the total number of release audit warnings. +1 checkstyle 7m 40s There were no new checkstyle issues. +1 install 1m 35s mvn install still works. +1 eclipse:eclipse 0m 33s The patch built with eclipse:eclipse. +1 findbugs 1m 59s The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 yarn tests 6m 57s Tests passed in hadoop-yarn-client. +1 yarn tests 52m 33s Tests passed in hadoop-yarn-server-resourcemanager.     103m 32s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12727301/YARN-2605.2.patch Optional Tests javac unit findbugs checkstyle javadoc git revision trunk / 12f4df0 hadoop-yarn-client test log https://builds.apache.org/job/PreCommit-YARN-Build/7452/artifact/patchprocess/testrun_hadoop-yarn-client.txt hadoop-yarn-server-resourcemanager test log https://builds.apache.org/job/PreCommit-YARN-Build/7452/artifact/patchprocess/testrun_hadoop-yarn-server-resourcemanager.txt Test Results https://builds.apache.org/job/PreCommit-YARN-Build/7452/testReport/ Console output https://builds.apache.org/job/PreCommit-YARN-Build/7452//console This message was automatically generated.
          Hide
          stevel@apache.org Steve Loughran added a comment -

          +1

          Show
          stevel@apache.org Steve Loughran added a comment - +1
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #7644 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7644/)
          YARN-2605. [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243)

          • hadoop-yarn-project/CHANGES.txt
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #7644 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7644/ ) YARN-2605 . [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243) hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk #2104 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2104/)
          YARN-2605. [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          • hadoop-yarn-project/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #2104 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2104/ ) YARN-2605 . [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java hadoop-yarn-project/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #163 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/163/)
          YARN-2605. [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          • hadoop-yarn-project/CHANGES.txt
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #163 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/163/ ) YARN-2605 . [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java hadoop-yarn-project/CHANGES.txt
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #172 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/172/)
          YARN-2605. [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          • hadoop-yarn-project/CHANGES.txt
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #172 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/172/ ) YARN-2605 . [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          Hide
          hudson Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Yarn-trunk #906 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/906/)
          YARN-2605. [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          • hadoop-yarn-project/CHANGES.txt
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          Show
          hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #906 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/906/ ) YARN-2605 . [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #173 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/173/)
          YARN-2605. [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243)

          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          • hadoop-yarn-project/CHANGES.txt
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #173 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/173/ ) YARN-2605 . [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243) hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          Hide
          hudson Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #2122 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2122/)
          YARN-2605. [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243)

          • hadoop-yarn-project/CHANGES.txt
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java
          • hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          Show
          hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2122 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2122/ ) YARN-2605 . [RM HA] Rest api endpoints doing redirect incorrectly. (Xuan Gong via stevel) (stevel: rev d9bcf99aef23f71391c728279698f4265a8d1243) hadoop-yarn-project/CHANGES.txt hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java
          Hide
          cheersyang Weiwei Yang added a comment -

          Hello Xuan Gong

          I noticed that you set an Ignore tag for testRMWebAppRedirect in your patch, can you please let me know why to ignore this test case ? Any idea that how to fix this ? I opened another JIRA YARN-3601, please let me know if that one is valid.

          Show
          cheersyang Weiwei Yang added a comment - Hello Xuan Gong I noticed that you set an Ignore tag for testRMWebAppRedirect in your patch, can you please let me know why to ignore this test case ? Any idea that how to fix this ? I opened another JIRA YARN-3601 , please let me know if that one is valid.

            People

            • Assignee:
              xgong Xuan Gong
              Reporter:
              bcwalrus bc Wong
            • Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development