You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2021/11/12 18:45:23 UTC

[GitHub] [httpcomponents-client] carterkozak opened a new pull request #325: HTTPCLIENT-2184: Fix classic client connection reuse

carterkozak opened a new pull request #325:
URL: https://github.com/apache/httpcomponents-client/pull/325


   This fixes an issue in which connections were not returned to the
   pool when requests contained non-repeatable bodies AND responses
   were streamed. When both of these criteria were met, responses
   were returned without ResponseEntityProxy enhancements so that
   closing the response entity or stream no longer completed the
   exchange, thus leaking the connection which forever lived in the
   `leased` state in the connection pool.


-- 
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: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] carterkozak commented on pull request #325: HTTPCLIENT-2184: Fix classic client connection reuse

Posted by GitBox <gi...@apache.org>.
carterkozak commented on pull request #325:
URL: https://github.com/apache/httpcomponents-client/pull/325#issuecomment-967708269


   Thanks for the quick review! I've applied this patch to the master and 5.1.x branches.


-- 
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: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] schlosna commented on a change in pull request #325: HTTPCLIENT-2184: Fix classic client connection reuse

Posted by GitBox <gi...@apache.org>.
schlosna commented on a change in pull request #325:
URL: https://github.com/apache/httpcomponents-client/pull/325#discussion_r748562301



##########
File path: httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ProtocolExec.java
##########
@@ -201,13 +201,15 @@ public ClassicHttpResponse execute(
 
                 if (Method.TRACE.isSame(request.getMethod())) {
                     // Do not perform authentication for TRACE request
+                    ResponseEntityProxy.enhance(response, execRuntime);

Review comment:
       Is there any code path in this method where we wouldn't want to enhance the `response` with the `execRuntime`? Github won't let me add the suggested change below as its outside the diff context, but should we consider pulling this & line 212 up to line 198 after creating `response` from the chain?
   
   ```
                   final ClassicHttpResponse response = chain.proceed(request, scope);
                   ResponseEntityProxy.enhance(response, execRuntime);
   ```




-- 
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: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] carterkozak closed pull request #325: HTTPCLIENT-2184: Fix classic client connection reuse

Posted by GitBox <gi...@apache.org>.
carterkozak closed pull request #325:
URL: https://github.com/apache/httpcomponents-client/pull/325


   


-- 
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: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] ok2c commented on a change in pull request #325: HTTPCLIENT-2184: Fix classic client connection reuse

Posted by GitBox <gi...@apache.org>.
ok2c commented on a change in pull request #325:
URL: https://github.com/apache/httpcomponents-client/pull/325#discussion_r748704099



##########
File path: httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/ProtocolExec.java
##########
@@ -201,13 +201,15 @@ public ClassicHttpResponse execute(
 
                 if (Method.TRACE.isSame(request.getMethod())) {
                     // Do not perform authentication for TRACE request
+                    ResponseEntityProxy.enhance(response, execRuntime);

Review comment:
       @schlosna All responses returned by the `ProtocolExec` interceptor must be enhanced to automatically release the underlying connection upon response content consumption. There is certainly a room for minor refactoring. Feel free to propose a PR.




-- 
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: dev-unsubscribe@hc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org