[aether-dependency-resolver] IJI-1457 Disable all errors caching

Switch from `ResolutionErrorPolicy.CACHE_NOT_FOUND` to
`ResolutionErrorPolicy.CACHE_DISABLED`, because with
`CACHE_NOT_FOUND`  5xx response is still cached in local
repository and not re-requested, see IJI-1457

GitOrigin-RevId: 22c9953d8087c719190e49f8b00781dbd2e4206c
This commit is contained in:
Vladislav.Yaroshchuk
2023-12-08 09:14:17 +04:00
committed by intellij-monorepo-bot
parent 5d7ae58a73
commit 88fc03be53

View File

@@ -162,8 +162,11 @@ public final class ArtifactRepositoryManager {
// Disable transfer errors caching to force re-request missing artifacts and metadata on network failures.
// Despite this, some errors are still cached in session data, and for proper retries work we must reset this data after failure
// what's performed by retryWithClearSessionData()
var artifactCachePolicy = ResolutionErrorPolicy.CACHE_NOT_FOUND;
var metadataCachePolicy = ResolutionErrorPolicy.CACHE_NOT_FOUND;
//
// a note: ResolutionErrorPolicy.CACHE_NOT_FOUND is not suitable because 5xx response is still cached in local repository and
// not re-requested, see IJI-1457
var artifactCachePolicy = ResolutionErrorPolicy.CACHE_DISABLED;
var metadataCachePolicy = ResolutionErrorPolicy.CACHE_DISABLED;
session.setResolutionErrorPolicy(new SimpleResolutionErrorPolicy(artifactCachePolicy, metadataCachePolicy));
session.setCache(new DefaultRepositoryCache());