Remove RetryException.
Retries should be an implementation detail of the cache client implementation. No client is interested in the number of retry attempts, so it seems better to make the retry code transparent with respect to exceptions. The retry code also wrapped arbitrary exceptions with RetryException. It is now the responsibility of the cache implementation code to convert low-level exceptions to IOException or an error meaningful at higher layers like CacheNotFoundException. For example, the gRPC action cache and remote executor now explicitly convert StatusRuntimeException into IOException.
Also, remove PassThroughException, since it's unused.
This should fix https://github.com/bazelbuild/bazel/issues/6308.
Closes #7009.
PiperOrigin-RevId: 230728718
diff --git a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java
index d941685..66a0b23 100644
--- a/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java
+++ b/src/main/java/com/google/devtools/build/lib/remote/RemoteSpawnCache.java
@@ -158,15 +158,15 @@
.build();
return SpawnCache.success(spawnResult);
}
+ } catch (CacheNotFoundException e) {
+ // Intentionally left blank
} catch (IOException e) {
- if (!AbstractRemoteActionCache.causedByCacheMiss(e)) {
- String errorMsg = e.getMessage();
- if (isNullOrEmpty(errorMsg)) {
+ String errorMsg = e.getMessage();
+ if (isNullOrEmpty(errorMsg)) {
errorMsg = e.getClass().getSimpleName();
- }
+ }
errorMsg = "Reading from Remote Cache:\n" + errorMsg;
report(Event.warn(errorMsg));
- }
} finally {
withMetadata.detach(previous);
}