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
When handling a response with a body, if an ExecutionInterceptor.modifyHttpResponse or ExecutionInterceptor.modifyHttpResponseContent method throws an exception, the HTTP connection is never closed.
Expected Behavior
Any time an AwsClient isn't returning the response stream to the caller, it should close the response itself, releasing the connection back to the pool.
Current Behavior
The connection remains open. This eventually exhausts the connection pool and causes subsequent requests to hang forever.
The problem probably exists in other places, though. I'm not familiar enough with this system to say what a complete solution should be.
Additional Information/Context
It's possible to work around this issue by wrapping all of your own modifyHttpResponse/modifyHttpResponseContent implementations in try/catch/close/rethrow. However, I don't think it's reasonable to expect these methods to close a stream that they didn't create. modifyHttpResponse doesn't even use the stream normally.
AWS Java SDK version used
2.23.4
JDK version used
openjdk version "17.0.10" 2024-01-16
Operating System and version
Ubuntu 20.04
The text was updated successfully, but these errors were encountered:
Describe the bug
When handling a response with a body, if an
ExecutionInterceptor.modifyHttpResponse
orExecutionInterceptor.modifyHttpResponseContent
method throws an exception, the HTTP connection is never closed.Expected Behavior
Any time an AwsClient isn't returning the response stream to the caller, it should close the response itself, releasing the connection back to the pool.
Current Behavior
The connection remains open. This eventually exhausts the connection pool and causes subsequent requests to hang forever.
Reproduction Steps
After the 50th exception,
getObject
gets stuck waiting for a connection.Possible Solution
ExecutionInterceptorChain.modifyHttpResponse
could catch all exceptions, and close the current response stream before rethrowing.Something like
The problem probably exists in other places, though. I'm not familiar enough with this system to say what a complete solution should be.
Additional Information/Context
It's possible to work around this issue by wrapping all of your own
modifyHttpResponse
/modifyHttpResponseContent
implementations in try/catch/close/rethrow. However, I don't think it's reasonable to expect these methods to close a stream that they didn't create.modifyHttpResponse
doesn't even use the stream normally.AWS Java SDK version used
2.23.4
JDK version used
openjdk version "17.0.10" 2024-01-16
Operating System and version
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: