Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A04CA200B13 for ; Wed, 15 Jun 2016 16:28:03 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9F3D2160A57; Wed, 15 Jun 2016 14:28:03 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id F0D6A160A19 for ; Wed, 15 Jun 2016 16:28:02 +0200 (CEST) Received: (qmail 60109 invoked by uid 500); 15 Jun 2016 14:28:02 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 60086 invoked by uid 99); 15 Jun 2016 14:28:02 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Jun 2016 14:28:02 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EED26DFBA8; Wed, 15 Jun 2016 14:28:01 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aonishuk@apache.org To: commits@ambari.apache.org Message-Id: <1f733ed44b104da38f86336a29cc847d@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Wed, 15 Jun 2016 14:28:03 -0000 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 Authored: Wed Jun 15 17:27:18 2016 +0300 Committer: Andrew Onishuk 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.")