ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-17256. Yarn service check fails after Ambari upgrade from 2.0.2 to 2.4.0.0 (aonishuk)
Date Wed, 15 Jun 2016 14:28:01 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 8d6213363 -> e67780109


AMBARI-17256. Yarn service check fails after Ambari upgrade from 2.0.2 to 2.4.0.0 (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e6778010
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e6778010
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e6778010

Branch: refs/heads/branch-2.4
Commit: e67780109a805e138792a1a2107dfebc33577741
Parents: 8d62133
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed Jun 15 17:27:18 2016 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed Jun 15 17:27:18 2016 +0300

----------------------------------------------------------------------
 .../YARN/2.1.0.2.0/package/scripts/service_check.py    | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e6778010/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
index 4556058..daa8e7e 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/service_check.py
@@ -30,6 +30,8 @@ from ambari_commons.os_family_impl import OsFamilyImpl
 from resource_management.libraries.functions import StackFeature
 from resource_management.libraries.functions.stack_features import check_stack_feature
 from resource_management.libraries.functions.get_user_call_output import get_user_call_output
+from resource_management.core.exceptions import Fail
+from resource_management.core.logger import Logger
 
 CURL_CONNECTION_TIMEOUT = '5'
 
@@ -133,18 +135,23 @@ class ServiceCheckDefault(ServiceCheck):
                                             user=params.smokeuser,
                                             path='/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
                                             )
+      
+      # Handle HDP<2.2.8.1 where RM doesn't do automatic redirection from standby to active
+      if stdout.startswith("This is standby RM. Redirecting to the current active RM:"):
+        Logger.info(format("Skipped checking of {rm_webapp_address} since returned '{stdout}'"))
+        continue
 
       try:
         json_response = json.loads(stdout)
       except Exception as e:
-        raise Exception("Could not get json response from YARN API")
+        raise Fail(format("Response from YARN API was not a valid JSON. Response: {stdout}"))
       
       if json_response is None or 'app' not in json_response or \
               'state' not in json_response['app'] or 'finalStatus' not in json_response['app']:
-        raise Exception("Application " + app_url + " returns invalid data.")
+        raise Fail("Application " + app_url + " returns invalid data.")
 
       if json_response['app']['state'] != "FINISHED" or json_response['app']['finalStatus']
!= "SUCCEEDED":
-        raise Exception("Application " + app_url + " state/status is not valid. Should be
FINISHED/SUCCEEDED.")
+        raise Fail("Application " + app_url + " state/status is not valid. Should be FINISHED/SUCCEEDED.")
 
 
 


Mime
View raw message