You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Jon Moore (JIRA)" <ji...@apache.org> on 2011/03/22 21:14:05 UTC

[jira] [Created] (HTTPCLIENT-1073) cache module generates exceptions for non-compliant responses without consuming response bodies

cache module generates exceptions for non-compliant responses without consuming response bodies
-----------------------------------------------------------------------------------------------

                 Key: HTTPCLIENT-1073
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1073
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: Cache
    Affects Versions: 4.1 Final, 4.1 Beta1, 4.1.1, 4.2 Final
            Reporter: Jon Moore
            Assignee: Jon Moore


In the ResponseProtocolCompliance class, the caching module checks the incoming origin response to attempt to make it compliant with RFC2616. However, if there are instances where this is not possible, it currently throws an exception without consuming the origin response body; this causes a connection leak if the general try..catch..finally pattern documented on the HttpClient interface Javadoc is followed.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Resolved] (HTTPCLIENT-1073) cache module generates exceptions for non-compliant responses without consuming response bodies

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jon Moore resolved HTTPCLIENT-1073.
-----------------------------------

    Resolution: Fixed

> cache module generates exceptions for non-compliant responses without consuming response bodies
> -----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1073
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1073
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1 Beta1, 4.1 Final, 4.1.1, 4.2 Final
>            Reporter: Jon Moore
>            Assignee: Jon Moore
>             Fix For: 4.1.2, 4.2 Alpha1
>
>         Attachments: 1073.patch
>
>
> In the ResponseProtocolCompliance class, the caching module checks the incoming origin response to attempt to make it compliant with RFC2616. However, if there are instances where this is not possible, it currently throws an exception without consuming the origin response body; this causes a connection leak if the general try..catch..finally pattern documented on the HttpClient interface Javadoc is followed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (HTTPCLIENT-1073) cache module generates exceptions for non-compliant responses without consuming response bodies

Posted by "Oleg Kalnichevski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oleg Kalnichevski updated HTTPCLIENT-1073:
------------------------------------------

    Fix Version/s: 4.2 Alpha1
                   4.1.2

Option C sounds good enough to me.

Please do not forget to merge changes you would like included in the 4.1.2 release (if it ever happens) to 4.1.x branch.

Oleg 

> cache module generates exceptions for non-compliant responses without consuming response bodies
> -----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1073
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1073
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1 Beta1, 4.1 Final, 4.1.1, 4.2 Final
>            Reporter: Jon Moore
>            Assignee: Jon Moore
>             Fix For: 4.1.2, 4.2 Alpha1
>
>         Attachments: 1073.patch
>
>
> In the ResponseProtocolCompliance class, the caching module checks the incoming origin response to attempt to make it compliant with RFC2616. However, if there are instances where this is not possible, it currently throws an exception without consuming the origin response body; this causes a connection leak if the general try..catch..finally pattern documented on the HttpClient interface Javadoc is followed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Updated] (HTTPCLIENT-1073) cache module generates exceptions for non-compliant responses without consuming response bodies

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jon Moore updated HTTPCLIENT-1073:
----------------------------------

    Attachment: 1073.patch

The attached patch implements option (c) above. I'll commit it tomorrow if there aren't any objections to this approach.


> cache module generates exceptions for non-compliant responses without consuming response bodies
> -----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1073
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1073
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1 Beta1, 4.1 Final, 4.1.1, 4.2 Final
>            Reporter: Jon Moore
>            Assignee: Jon Moore
>         Attachments: 1073.patch
>
>
> In the ResponseProtocolCompliance class, the caching module checks the incoming origin response to attempt to make it compliant with RFC2616. However, if there are instances where this is not possible, it currently throws an exception without consuming the origin response body; this causes a connection leak if the general try..catch..finally pattern documented on the HttpClient interface Javadoc is followed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (HTTPCLIENT-1073) cache module generates exceptions for non-compliant responses without consuming response bodies

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009820#comment-13009820 ] 

Jon Moore commented on HTTPCLIENT-1073:
---------------------------------------

I believe the correct fix for this problem is one of:
(a) document the proper workaround for the client to avoid the connection leak (perhaps using HttpUriRequest#abort)
(b) have the caching module consume the response body if present before throwing the exception
(c) don't throw an exception here and just treat the noncompliant response as cache-invalidating and uncacheable.

I think my personal preference is (c) and will start working on a patch to that effect.


> cache module generates exceptions for non-compliant responses without consuming response bodies
> -----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1073
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1073
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1 Beta1, 4.1 Final, 4.1.1, 4.2 Final
>            Reporter: Jon Moore
>            Assignee: Jon Moore
>
> In the ResponseProtocolCompliance class, the caching module checks the incoming origin response to attempt to make it compliant with RFC2616. However, if there are instances where this is not possible, it currently throws an exception without consuming the origin response body; this causes a connection leak if the general try..catch..finally pattern documented on the HttpClient interface Javadoc is followed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (HTTPCLIENT-1073) cache module generates exceptions for non-compliant responses without consuming response bodies

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010164#comment-13010164 ] 

Jon Moore commented on HTTPCLIENT-1073:
---------------------------------------

@Oleg: will do on the branch merge.


> cache module generates exceptions for non-compliant responses without consuming response bodies
> -----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1073
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1073
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1 Beta1, 4.1 Final, 4.1.1, 4.2 Final
>            Reporter: Jon Moore
>            Assignee: Jon Moore
>             Fix For: 4.1.2, 4.2 Alpha1
>
>         Attachments: 1073.patch
>
>
> In the ResponseProtocolCompliance class, the caching module checks the incoming origin response to attempt to make it compliant with RFC2616. However, if there are instances where this is not possible, it currently throws an exception without consuming the origin response body; this causes a connection leak if the general try..catch..finally pattern documented on the HttpClient interface Javadoc is followed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Commented] (HTTPCLIENT-1073) cache module generates exceptions for non-compliant responses without consuming response bodies

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010122#comment-13010122 ] 

Jon Moore commented on HTTPCLIENT-1073:
---------------------------------------

Ok, after sleeping on it, I think the fix warrants a little deeper analysis than the patch I posted. For example, if the origin response is a 401 missing the WWW-Authenticate header, this is strictly non-compliant, but shouldn't affect the caching module, and a client not using the caching module would have to deal with this anyway; so this compliance test ought to be removed. I'll check the other ones -- there are only about 4 unit tests and associated code.

> cache module generates exceptions for non-compliant responses without consuming response bodies
> -----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1073
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1073
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1 Beta1, 4.1 Final, 4.1.1, 4.2 Final
>            Reporter: Jon Moore
>            Assignee: Jon Moore
>         Attachments: 1073.patch
>
>
> In the ResponseProtocolCompliance class, the caching module checks the incoming origin response to attempt to make it compliant with RFC2616. However, if there are instances where this is not possible, it currently throws an exception without consuming the origin response body; this causes a connection leak if the general try..catch..finally pattern documented on the HttpClient interface Javadoc is followed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


[jira] [Closed] (HTTPCLIENT-1073) cache module generates exceptions for non-compliant responses without consuming response bodies

Posted by "Jon Moore (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jon Moore closed HTTPCLIENT-1073.
---------------------------------


> cache module generates exceptions for non-compliant responses without consuming response bodies
> -----------------------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1073
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1073
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.1 Beta1, 4.1 Final, 4.1.1, 4.2 Final
>            Reporter: Jon Moore
>            Assignee: Jon Moore
>             Fix For: 4.1.2, 4.2 Alpha1
>
>         Attachments: 1073.patch
>
>
> In the ResponseProtocolCompliance class, the caching module checks the incoming origin response to attempt to make it compliant with RFC2616. However, if there are instances where this is not possible, it currently throws an exception without consuming the origin response body; this causes a connection leak if the general try..catch..finally pattern documented on the HttpClient interface Javadoc is followed.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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