You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "Naoki Takezoe (Jira)" <ji...@apache.org> on 2025/04/25 00:27:00 UTC

[jira] [Updated] (RANGER-5201) Retry GET request on server error in RangerRESTClient

     [ https://issues.apache.org/jira/browse/RANGER-5201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Naoki Takezoe updated RANGER-5201:
----------------------------------
    Description: 
RangerRESTClient has a retry mechanism for connectivity errors that was implemented in https://issues.apache.org/jira/browse/RANGER-3565 but it doesn't retry HTTP 5xx errors because it works only when ClientHandlerException is thrown: https://github.com/apache/ranger/blob/dbaad69de10ff7b21b5bd3fc08c4b65b4aa25dff/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java#L409-L415

while Jersey's default client handler that is used in RangerRESTClient doesn't raise an exception even for 5xx errors:
https://github.com/javaee/jersey-1.x/blob/1.19.3/jersey-client/src/main/java/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.java

Therefore, policy retrieval immediately fails without retry when, for example, ranger-admin behind a reverse proxy is temporarily unavailable.

It's better to retry GET requests also on HTTP 5xx errors in RangerRESTClient.

  was:
RangerRESTClient has a retry mechanism for connectivity errors that was implemented in https://issues.apache.org/jira/browse/RANGER-3565 but it doesn't retry HTTP 5xx errors because it works only when ClientHandlerException is thrown: https://github.com/apache/ranger/blob/dbaad69de10ff7b21b5bd3fc08c4b65b4aa25dff/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java#L409-L415

while Jersey's default client handler that is used in RangerRESTClient doesn't raise an exception even for 5xx errors:
https://github.com/javaee/jersey-1.x/blob/1.19.3/jersey-client/src/main/java/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.java

It's better to retry policy retrieval requests on HTTP 5xx errors too.


> Retry GET request on server error in RangerRESTClient
> -----------------------------------------------------
>
>                 Key: RANGER-5201
>                 URL: https://issues.apache.org/jira/browse/RANGER-5201
>             Project: Ranger
>          Issue Type: Improvement
>          Components: plugins
>            Reporter: Naoki Takezoe
>            Priority: Minor
>
> RangerRESTClient has a retry mechanism for connectivity errors that was implemented in https://issues.apache.org/jira/browse/RANGER-3565 but it doesn't retry HTTP 5xx errors because it works only when ClientHandlerException is thrown: https://github.com/apache/ranger/blob/dbaad69de10ff7b21b5bd3fc08c4b65b4aa25dff/agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java#L409-L415
> while Jersey's default client handler that is used in RangerRESTClient doesn't raise an exception even for 5xx errors:
> https://github.com/javaee/jersey-1.x/blob/1.19.3/jersey-client/src/main/java/com/sun/jersey/client/urlconnection/URLConnectionClientHandler.java
> Therefore, policy retrieval immediately fails without retry when, for example, ranger-admin behind a reverse proxy is temporarily unavailable.
> It's better to retry GET requests also on HTTP 5xx errors in RangerRESTClient.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)