ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gautam Borad <gbo...@gmail.com>
Subject Re: Review Request 42452: AMBARI-14710 : Add retry logic for REST calls between Ambari and Ranger
Date Mon, 25 Jan 2016 11:45:26 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/42452/
-----------------------------------------------------------

(Updated Jan. 25, 2016, 11:45 a.m.)


Review request for Ambari, Alejandro Fernandez, Andrew Onischuk, Jaimin Jetly, Mahadev Konar,
Sumit Mohanty, Selvamohan Neethiraj, Sebastian Toader, and Velmurugan Periasamy.


Changes
-------

Update the timeout to 10 mins and adjust the backoff_factor.


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 (updated)
-----

  ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions.py
e302235 
  ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py
6624c89 

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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message