Copilot commented on code in PR #8798:
URL: https://github.com/apache/hbase/pull/8798#discussion_r4332988760
##########
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/replication/VerifyReplicationRecompareRunnable.java:
##########
@@ -109,7 +109,7 @@ public void run() {
}
}
- sleepMs = sleepMs * (2 ^ reCompareBackoffExponent);
+ sleepMs = (int) (sleepMs * Math.pow(2, reCompareBackoffExponent));
Review Comment:
Casting the result of `sleepMs * Math.pow(...)` to `int` can
truncate/overflow and potentially produce negative or zero sleep values for
larger exponents. Prefer computing in `long`/`double` and clamping to a safe
upper bound (and possibly a minimum of 1ms) before assignment, or store
`sleepMs` as `long` if feasible to preserve correctness.
--
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]