You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "vyommani (via GitHub)" <gi...@apache.org> on 2025/12/08 09:47:32 UTC

Re: [PR] RANGER-5397: IllegalArgumentException in RangerRESTClient when no ran… [ranger]

vyommani commented on code in PR #732:
URL: https://github.com/apache/ranger/pull/732#discussion_r2597861108


##########
agents-common/src/main/java/org/apache/ranger/plugin/util/RangerRESTClient.java:
##########
@@ -110,9 +110,13 @@ public RangerRESTClient(String url, String sslConfigFileName, Configuration conf
         mUrl               = url;
         mSslConfigFileName = sslConfigFileName;
         configuredURLs     = StringUtil.getURLs(mUrl);
-
-        setLastKnownActiveUrlIndex((new Random()).nextInt(getConfiguredURLs().size()));
-
+        int size = getConfiguredURLs().size();

Review Comment:
   I initially took the conservative/safe route and allowed it to continue with size = 0, but on second thought — this is actually a configuration error, not a valid runtime state.
   
   What do you think?
   
   Should we treat missing REST URLs as a fatal configuration error and throw an exception(throw new IllegalArgumentException("No valid REST URL configured. Please provide at least one valid URL.");)
   
   @mneethiraj  can you please comment on the above ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ranger.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org