| When the system clock jumps backwards SimpleTimestamper hangs in a "endless" loop and eats CPU time till the clock has reached at least the the time when the clock jumped backwards. Just run this
import java.util.Date;
import org.hibernate.cache.spi.support.SimpleTimestamper;
public class TimstamperTest {
public static void main(String... args) {
while (true) {
System.out.println(new Date() + " " + SimpleTimestamper.next());
try {
Thread.sleep(100);
}
catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
And then set the system clock to one day in the past. It will stop and instead just loop till you adjust the clock back again. Not a big deal if you have NTP and the clock varies just a few milliseconds before it is adjusted again. But if there is a bigger change for whatever reason this will crash your system. |