The following is from ModificationSet.java, and shows how CC decides if any modifications were in the quiet period and if so, sleeps for the what's remaining of the quietperiod time. It should then wake up and re-get the modifications and test the quiet period again. This should be retried until there are no modifications in the quiet period and CC can continue to start the build.
if(isLastModificationInQuietPeriod(_now, _modifications)) {
log.info("A modification has been detected in the quiet period. ");
log.info("Sleeping for " + getQuietPeriodDifference(_now, _modifications)/1000
+ "seconds before retrying.");
try {
Thread.sleep(getQuietPeriodDifference(_now, _modifications));
} catch (InterruptedException e) {
log.error("", e);
}
}
protected long getQuietPeriodDifference(_now, _modifications) {
long diff = quietPeriod - (_now - getLastModificationMillis(_modifications));
return Math.max(0, diff);
}
------------------
Isn't this code sample out of date? Probably, but the idea behind it is still correct. You can always look up the current source in the codebase if you want the up-to-the-minute version