adutra commented on code in PR #2035:
URL: 
https://github.com/apache/cassandra-java-driver/pull/2035#discussion_r2039352232


##########
core/src/main/java/com/datastax/oss/driver/internal/core/metadata/SniEndPoint.java:
##########
@@ -64,7 +64,7 @@ public InetSocketAddress resolve() {
       // The order of the returned address is unspecified. Sort by IP to make 
sure we get a true
       // round-robin
       Arrays.sort(aRecords, IP_COMPARATOR);
-      int index = (aRecords.length == 1) ? 0 : (int) OFFSET.getAndIncrement() 
% aRecords.length;
+      int index = (aRecords.length == 1) ? 0 : Math.abs((int) 
OFFSET.getAndIncrement()) % aRecords.length;

Review Comment:
   Why is `OFFSET` an `AtomicLong`, shouldn't it be an `AtomicInteger`?



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