kotman12 commented on code in PR #3357:
URL: https://github.com/apache/solr/pull/3357#discussion_r2145304235


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/HttpSolrClientBuilderBase.java:
##########
@@ -25,6 +25,12 @@
 
 public abstract class HttpSolrClientBuilderBase<
     B extends HttpSolrClientBuilderBase<?, ?>, C extends HttpSolrClientBase> {
+  /**
+   * About 24 days in milliseconds -- basically forever to wait for something. 
But not so large to
+   * cause overflow.
+   */
+  protected static final long FOREVER_MILLIS = Integer.MAX_VALUE;

Review Comment:
   @dsmiley if we are really worried about overflow here, should we bite the 
bullet and make this an int? This fallback value doesn't really prevent 
overflows since I could just do:
   
   ```
   .withIdleTimeout(Long.MAX_VALUE, TimeUnit.MILLISECONDS)
   ```
   which I incidentally did 
[here](https://github.com/apache/solr/pull/3356/files). To a future reviewer a 
change like this may seem reasonable, in fact you approved it and you are 
reasonable 😄 . But if this will overflow in some low-level lossy cast to int 
then this is still dangerous and the `FOREVER_MILLIS`, although 
well-intentioned, just adds noise IMO without really providing much protection.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to