Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CCEC5183AB for ; Thu, 21 Jan 2016 14:11:19 +0000 (UTC) Received: (qmail 32903 invoked by uid 500); 21 Jan 2016 14:11:19 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 32868 invoked by uid 500); 21 Jan 2016 14:11:19 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 32845 invoked by uid 99); 21 Jan 2016 14:11:19 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2016 14:11:19 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 2C45D2829E0; Thu, 21 Jan 2016 14:11:18 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7880821959635805700==" MIME-Version: 1.0 Subject: Re: Review Request 42452: AMBARI-14710 : Add retry logic for REST calls between Ambari and Ranger From: "Sebastian Toader" To: "Mahadev Konar" , "Sumit Mohanty" , "Selvamohan Neethiraj" , "Andrew Onischuk" , "Sebastian Toader" , "Alejandro Fernandez" , "Jaimin Jetly" , "Velmurugan Periasamy" Cc: "Ambari" , "Gautam Borad" Date: Thu, 21 Jan 2016 14:11:18 -0000 Message-ID: <20160121141118.32038.45162@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Sebastian Toader" X-ReviewGroup: Ambari X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/42452/ X-Sender: "Sebastian Toader" References: <20160121134652.32038.91443@reviews.apache.org> In-Reply-To: <20160121134652.32038.91443@reviews.apache.org> Reply-To: "Sebastian Toader" X-ReviewRequest-Repository: ambari --===============7880821959635805700== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/42452/#review115628 ----------------------------------------------------------- Ship it! Ship It! - Sebastian Toader On Jan. 21, 2016, 2:46 p.m., Gautam Borad wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/42452/ > ----------------------------------------------------------- > > (Updated Jan. 21, 2016, 2:46 p.m.) > > > Review request for Ambari, Alejandro Fernandez, Andrew Onischuk, Jaimin Jetly, Mahadev Konar, Sumit Mohanty, Selvamohan Neethiraj, Sebastian Toader, and Velmurugan Periasamy. > > > Bugs: AMBARI-14710 > https://issues.apache.org/jira/browse/AMBARI-14710 > > > Repository: ambari > > > Description > ------- > > Current implementation of check_ranger_login_urllib2 in ranger_functions.py and ranger_functions_v2.py triggers the retry logic under the safe_retry decorator only for the Timeout error. > > This logic should be triggered for the exceptions also, to ensure that Ranger Admin is given enough time to start up before giving up. > > > Diffs > ----- > > ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py c59dc8d > ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py a72be33 > > Diff: https://reviews.apache.org/r/42452/diff/ > > > Testing > ------- > > * Provision a 3 node cluster with HDFS, Hive, Ranger. > * Add Ranger after initial cluster bringup > * Shut down Ranger Admin > * Enable Ranger for HDFS > * Start Ranger Admin simultaneously with Namenode Restart > > Observations : > > * The retry logic is triggered > * Since Ranger is simultaneously coming up in another thread, we hit both the exceptions as shown in the log below. > * The component start is not blocked even if Ranger is not up > > ``` > 2016-01-18 07:18:40,583 - Rangeradmin: Skip ranger admin if it's down ! > 2016-01-18 07:18:40,587 - Will retry 4 time(s), caught exception: Connection to Ranger Admin failed. Reason - [Errno 111] Connection refused.. Sleeping for 8 sec(s) > 2016-01-18 07:19:08,597 - Will retry 3 time(s), caught exception: Connection to Ranger Admin failed. Reason - timeout. Sleeping for 8 sec(s) > 2016-01-18 07:19:18,219 - amb_ranger_admin user is not present, creating user using given configurations > 2016-01-18 07:19:18,621 - Ambari admin user creation successful. > 2016-01-18 07:19:19,514 - Repository created Successfully > 2016-01-18 07:19:20,194 - Policy updated Successfully > 2016-01-18 07:19:20,195 - Ranger Repository created successfully and policies updated successfully providing ambari-qa user all permissions > ``` > > > Thanks, > > Gautam Borad > > --===============7880821959635805700==--