You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Without any apparent reason, sometimes I get this exception java.lang.IllegalStateException: Connection pool shut down and all requests to DynamoDB fail.
And have a single client running in the app configured with Spring @bean
@Bean
public DynamoDbEnhancedClient dynamoDbClient(
@Value("${dynamodb.use-localstack:false}") boolean useLocalStack,
@Value("${LOCALSTACK_CUSTOM_ENDPOINT:}") String customEndpoint) {
DynamoDbClientBuilder builder = DynamoDbClient.builder();
if (useLocalStack) {
// Point to LocalStack endpoint
builder.endpointOverride(URI.create(customEndpoint))
.region(Region.of("eu-central-1")); // LocalStack doesn't care much about the region
} else {
// AWS Configuration
builder.region(Region.EU_CENTRAL_1);
}
DynamoDbClient dynamoDbClient = builder.build();
DynamoDbEnhancedClient enhancedClient = DynamoDbEnhancedClient.builder()
.dynamoDbClient(dynamoDbClient)
.build();
return enhancedClient;
}
Expected Behavior
I expect that no exceptions arise.
Current Behavior
java.lang.IllegalStateException: Connection pool shut down
at org.apache.http.util.Asserts.check(Asserts.java:34)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.requestConnection(PoolingHttpClientConnectionManager.java:269)
at software.amazon.awssdk.http.apache.internal.conn.ClientConnectionManagerFactory$DelegatingHttpClientConnectionManager.requestConnection(ClientConnectionManagerFactory.java:75)
at software.amazon.awssdk.http.apache.internal.conn.ClientConnectionManagerFactory$InstrumentedHttpClientConnectionManager.requestConnection(ClientConnectionManagerFactory.java:57)
...
debora-ito
added
closing-soon
This issue will close in 4 days unless further comments are made.
p3
This is a minor priority issue
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Sep 6, 2024
Thanks for the reply. I did check everything in the docs. There don't seem to be any Errors thrown. I checked the memory usage and it appeared to be relatively low. DefaultCredentialsProvider we don't use. The SDK lifecycle is managed by Spring via @bean.
So I'm out of ideas. I'll keep digging / profiling, but if there is anything else I could try, please let me know.
Describe the bug
Without any apparent reason, sometimes I get this exception
java.lang.IllegalStateException: Connection pool shut down
and all requests to DynamoDB fail.I am using DynamoDB Enhanced Client:
And have a single client running in the app configured with Spring @bean
Expected Behavior
I expect that no exceptions arise.
Current Behavior
stacktrace_2.txt
stacktrace_1.txt
Reproduction Steps
This happens very rarely, without an apparent reason. Sometimes even months in between. I could not find what causes it.
Possible Solution
No response
Additional Information/Context
I am performing some queries in Async context using completable future:
AWS Java SDK version used
software.amazon.awssdk 2.21.37
JDK version used
amazoncorretto:21.0.1
Operating System and version
amazoncorretto:21.0.1
The text was updated successfully, but these errors were encountered: