private void backoff(int retryCount, Instant end) {
        try {
            long sleepTime = Math.min(120_000,
                                      Math.min((long) (Math.pow(2, retryCount)) * backoffInitialTime.toMillis(),
                                               Duration.between(Instant.now(), end).toMillis()));
            if (sleepTime <= 0) return;

            var endSleep = Instant.now().plusMillis(sleepTime);
            do {
                Thread.sleep(Math.min(100, sleepTime));
            } while (Instant.now().isBefore(endSleep) && ! shutDown.get());
        } catch (InterruptedException e) {
            /* ignored */
        }
    }
Downloads file reference from config server and keeps track of files being downloaded

@author hmusum
filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileReferenceDownloader.java