Skip to content

Commit

Permalink
Cache failures accessing configurations for buckets.
Browse files Browse the repository at this point in the history
  • Loading branch information
dkocher committed Nov 8, 2024
1 parent b0bda2b commit 35dfb14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public VersioningConfiguration getConfiguration(final Path file) throws Backgrou
throw new GoogleStorageExceptionMappingService().map("Failure to read attributes of {0}", e, bucket);
}
catch(AccessDeniedException l) {
cache.put(bucket, VersioningConfiguration.empty());
log.warn("Missing permission to read versioning configuration for {} {}", bucket, e.getMessage());
return VersioningConfiguration.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,12 @@ public VersioningConfiguration getConfiguration(final Path file) throws Backgrou
throw new S3ExceptionMappingService().map("Cannot read container configuration", e);
}
catch(AccessDeniedException l) {
cache.put(bucket, VersioningConfiguration.empty());
log.warn("Missing permission to read versioning configuration for {} {}", bucket, e.getMessage());
return VersioningConfiguration.empty();
}
catch(InteroperabilityException | NotfoundException i) {
cache.put(bucket, VersioningConfiguration.empty());
log.warn("Not supported to read versioning configuration for {} {}", bucket, e.getMessage());
return VersioningConfiguration.empty();
}
Expand Down

0 comments on commit 35dfb14

Please sign in to comment.