in src/main/java/com/aliyun/credentials/provider/RefreshCachedSupplier.java [67:91]
private void refreshCache() {
try {
boolean lockAcquired = refreshLock.tryLock(REFRESH_BLOCKING_MAX_WAIT, TimeUnit.MILLISECONDS);
try {
if (cacheIsStale() || shouldInitiateCachePrefetch()) {
try {
this.cachedValue = handleFetchedSuccess(refreshCallable.call());
} catch (Exception ex) {
this.cachedValue = handleFetchedFailure(ex);
}
}
} finally {
if (lockAcquired) {
refreshLock.unlock();
}
}
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted waiting to refresh the value.", ex);
} catch (CredentialException ex) {
throw ex;
} catch (Exception e) {
throw new CredentialException("Failed to refresh credentials.", e);
}
}