You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original code in guava-retrying in Retryer#call used System.nanoTime() to measure time elapsed since the first attempt was made, but the forked re-retrying library changed to use System.currentTimeMillis().
This was (incorrectly) changed in the re-retrying fork to use
currentTimeMillis() instead of nanoTime() to make the delay computation
"simpler", but it resulted in a potentially problematic calculation
since nanoTime is intended to be used for elapsed time computations in
Java. Using currentTimeMillis can can odd issues (e.g. a call to
currentTimeMillis could return a number less than a preceding call
and thus result in a negative elapsed time)
Fixes#13
This was (incorrectly) changed in the re-retrying fork to use
currentTimeMillis() instead of nanoTime() to make the delay computation
"simpler", but it resulted in a potentially problematic calculation
since nanoTime is intended to be used for elapsed time computations in
Java. Using currentTimeMillis can can odd issues (e.g. a call to
currentTimeMillis could return a number less than a preceding call
and thus result in a negative elapsed time)
Fixes#13
The original code in guava-retrying in Retryer#call used
System.nanoTime()
to measure time elapsed since the first attempt was made, but the forked re-retrying library changed to useSystem.currentTimeMillis()
.Change this code back to use
nanoTime()
..See https://stackoverflow.com/a/1776053 for one good answer or dropwizard/metrics#1361 for another, more interesting, scenario...
The text was updated successfully, but these errors were encountered: