suvodeep-pyne commented on code in PR #20442:
URL: https://github.com/apache/pinot/pull/20442#discussion_r4764987387
##########
pinot-plugins/pinot-file-system/pinot-s3/pom.xml:
##########
@@ -69,6 +69,11 @@
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
Review Comment:
We don't need it. I removed it in ad8adb7 and switched the test to TestNG
asserts, as in the rest of the module.
##########
pinot-plugins/pinot-file-system/pinot-s3/src/main/java/org/apache/pinot/plugin/filesystem/S3PinotFS.java:
##########
@@ -264,13 +265,18 @@ public AwsCredentials getAwsCredentials() {
/// Executes the given S3 operation, retrying once after refreshing AWS
credentials if an [S3Exception] occurs.
///
+ /// `AccessDenied` is not retried: a refresh cannot grant a missing
permission, and it closes the S3 client under
+ /// calls that are still using it.
+ ///
/// @param action the S3 operation to execute
/// @param <T> the type of the result returned by the operation
/// @return the result of the S3 operation
- /// @throws IOException if the operation fails after credential refresh
+ /// @throws IOException if S3 denies access or the retry fails
private <T> T retryWithS3CredentialRefresh(Supplier<T> action) throws
IOException {
try {
return action.get();
+ } catch (AccessDeniedException e) {
+ throw new IOException("S3 denied access to the request", e);
Review Comment:
Done in ad8adb7: the message now includes the S3 error message. On AWS that
message names the principal, the action and the resource, e.g. `S3 denied
access, not retrying with refreshed credentials: User:
arn:aws:iam::<account>:user/<user> is not authorized to perform: s3:ListBucket
on resource: "arn:aws:s3:::<bucket>" because no resource-based policy allows
the s3:ListBucket action (Service: S3, Status Code: 403, Request ID: ...)`.
##########
pinot-plugins/pinot-file-system/pinot-s3/pom.xml:
##########
@@ -69,6 +69,11 @@
<artifactId>testcontainers</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
Review Comment:
This is a pretty popular assertions library that pinot also uses in a bunch
of places. It makes assertions more readable.
https://www.baeldung.com/introduction-to-assertj
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]