klsince commented on issue #11761:
URL: https://github.com/apache/pinot/issues/11761#issuecomment-1771483018
not sure about the root cause.
But the awsCredentialsProvider is not closed when the else block is existed.
In Java, the autoclosable would be auto closed if it's put in a
`try(awsCredentialsProvider = ...) {...}` statement.
You said you were using role based access, then it's not the
`DefaultCredentialsProvider` but `StsAssumeRoleCredentialsProvider` to be used,
as in
[here](https://github.com/apache/pinot/blob/master/pinot-plugins/pinot-file-system/pinot-s3/src/main/java/org/apache/pinot/plugin/filesystem/S3PinotFS.java#L123)
```
if (StringUtils.isNotEmpty(s3Config.getAccessKey()) &&
StringUtils.isNotEmpty(s3Config.getSecretKey())) {
AwsBasicCredentials awsBasicCredentials =
AwsBasicCredentials.create(s3Config.getAccessKey(),
s3Config.getSecretKey());
awsCredentialsProvider =
StaticCredentialsProvider.create(awsBasicCredentials);
} else {
awsCredentialsProvider = DefaultCredentialsProvider.create(); <----
}
...
// IAM Role based access
if (s3Config.isIamRoleBasedAccess()) {
...
StsClient stsClient =
StsClient.builder().region(Region.of(s3Config.getRegion())).
credentialsProvider(awsCredentialsProvider).build(); <----
awsCredentialsProvider =
StsAssumeRoleCredentialsProvider.builder().stsClient(stsClient).refreshRequest(assumeRoleRequest)
.asyncCredentialUpdateEnabled(s3Config.isAsyncSessionUpdateEnabled()).build();
}
```
However, to create StsAssumeRoleCredentialsProvider, a StsClient object is
created firstly and it takes a `awsCredentialsProvider` of
DefaultCredentialsProvider type.
The issue you found https://github.com/aws/aws-sdk-java-v2/issues/4221
mentioned some potential cause like `OutOfMemory errors`, do you see such
errors or any other suspicious exceptions in the logs?
--
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]