问题
we have a web application use AWS (Amazone api), in the coreConfiguration class we create a awsApi bean with predestroy method, the code for coreConfiguration is:
@Bean(destroyMethod = "destroy")
public IGridStorageManager awsApi() {
.....
}
in awsApi class we have detroy methode, the code is:
@Override
@PreDestroy
public void destroy() {
if (clientS3 != null) {
clientS3.shutdown();
}
}
My problem is sometime in PROD when i use the API i see thos logs:
2020-08-03 11:27:00.090 DEBUG 25172 --- [java-sdk-http-connection-reaper] com.amazonaws.http.IdleConnectionReaper : Reaper thread:
java.lang.InterruptedException: sleep interrupted
at java.lang.Thread.sleep(Native Method)
at com.amazonaws.http.IdleConnectionReaper.run(IdleConnectionReaper.java:188)
I read that this exception can cause memory leak, i found that we need to use a shutdown() method, the problem is i aleardy use @preadestory method with shutdown method, why i have those exceptions ?
Can you help me ?
Thanks
来源:https://stackoverflow.com/questions/63242758/aws-interruptedexception-sleep-interrupted-com-amazonaws-http-idleconnectionrea