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

(Updated Jan. 18, 2016, 4:58 p.m.)


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


Summary (updated)
-----------------

AMBARI-14710 : Add retry logic for REST calls between Ambari and Ranger


Bugs: AMBARI-14170
    https://issues.apache.org/jira/browse/AMBARI-14170


Repository: ambari


Description (updated)
-------

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
 543a31f61f4f711919b47689c1eb9b6c961df3ee 
  
ambari-common/src/main/python/resource_management/libraries/functions/ranger_functions_v2.py
 80965a60e23cbd9faaf43da6ca63ce5863ac5199 

Diff: https://reviews.apache.org/r/42452/diff/


Testing (updated)
-------

* 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

Reply via email to