-
Notifications
You must be signed in to change notification settings - Fork 840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception occurs one hour after execution: (Connection pool shut down) #4386
Comments
So, in your code example, |
Thank you for the answer. |
|
Just to save someone else scratching their head for a while - |
Fun one. It means that on any process > 1h duration, if the first instance of the credential provider is closed, all other uses fail. Just had to review our code to make sure we don't do this. All good in s3afs as (a) we don't use this chain and (b) our list is ref counted (org.apache.hadoop.fs.s3a.AWSCredentialProviderList) and only closes itself when the ref count is 0. aws sdk should consider this The workaround to do here is wrap the default chain in your own credential provider implementation, one which doesn't implement close(). |
It's particularly 'fun' as the javadocs say:
Which isn't really true. Could be better named (maybe |
Any working code sample how to use credentials or refresh so that it still works after 1 hr , please ? I see similar issues are closed without a working solution suggested but answering this is expected behavior. Error:- java.lang.IllegalStateException: Connection pool shut down Code:- try(CloudWatchClient cw = CloudWatchClient.builder().region(region).credentialsProvider(DefaultCredentialsProvider.create()).build()){ // code } |
Switching |
Thanks @q-nathangrand DefaultCredentialsProvider.builder().build() - Fixed it. |
Describe the bug
This error has been occurring since upgrading from version 2.16.1 to 2.19.14.
It doesn't occur in all cases, but only when using specific credentials. It works well when receiving credentials through IMDS, but only occurs when using the file path of
AWS_WEB_IDENTITY_TOKEN_FILE
as an environment variable.Under the two conditions mentioned, it works well for one hour, but once one hour passes, the following error occurs.
It's difficult to identify the exact cause. If there are any suspected issues, please let me know.
Could I have made a mistake in using the SDK?
Expected Behavior
I expect it to continue functioning properly even as time passes.
Current Behavior
An error occurs after one hour has passed.
Reproduction Steps
When running this code with
2.19.14
version, an error occurs after one hour has passed.Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
2.19.14
JDK version used
openjdk 11.0.20.1 2023-08-24
Operating System and version
Ubuntu 22.04.2 LTS
The text was updated successfully, but these errors were encountered: