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

(Updated Jan. 21, 2016, 12:15 p.m.)


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


Changes
-------

Adding increased sleep_time=30 for retries for REST calls, to take care of 
simultaneus restarts.


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
 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

Reply via email to