You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "James Miller (Created) (JIRA)" <ji...@apache.org> on 2012/01/05 22:52:39 UTC

[jira] [Created] (HTTPCLIENT-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
---------------------------------------------------------------------------------

                 Key: HTTPCLIENT-1157
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: Cache
    Affects Versions: 4.2 Alpha1
            Reporter: James Miller


The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  

I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Jon Moore commented on HTTPCLIENT-1157:
---------------------------------------

@Oleg: I see you beat me to it. Thanks. :)

                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Jon Moore resolved HTTPCLIENT-1157.
-----------------------------------

    Resolution: Fixed

Backported to 4.1.x. @James: Please verify and close issue if appropriate. Thanks!
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Jon Moore commented on HTTPCLIENT-1157:
---------------------------------------

@James: patch committed to trunk. I also wrapped try...catch around the cache puts and cache deletes as well for completeness. Please take a look, and if that works for you I'll also backport to 4.1.x. Many thanks for this!

                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Sebb commented on HTTPCLIENT-1157:
----------------------------------

Agreed.

If we do decide to move to 1.6 minimum, it should be on the basis of some functionality that is only available in Java 1.6.
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Oleg Kalnichevski commented on HTTPCLIENT-1157:
-----------------------------------------------

@Jon. My pleasure. Truth to be told I was not going to, but I needed the trunk to be compilable to be able to publish the latest snapshot.

Oleg 
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

James Miller closed HTTPCLIENT-1157.
------------------------------------


Looks good, thanks!
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Oleg Kalnichevski updated HTTPCLIENT-1157:
------------------------------------------

    Fix Version/s: 4.2 Alpha2
                   4.1.3

If no one else steps in, I'll commit the patch in a few days

Oleg
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

James Miller updated HTTPCLIENT-1157:
-------------------------------------

    Attachment: HTTPCLIENT-1157.patch

Here is a patch wrapping the OperationTimeoutException as an IOException so that the normal code path can be followed.
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>              Labels: cache
>         Attachments: HTTPCLIENT-1157.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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] [Assigned] (HTTPCLIENT-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Jon Moore reassigned HTTPCLIENT-1157:
-------------------------------------

    Assignee: Jon Moore
    
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Jon Moore commented on HTTPCLIENT-1157:
---------------------------------------

@James: why not just wrap some try...catch blocks around the current calls to the MemcachedClientIF in MemcachedHttpCacheStorage? You can catch the OperationTimeoutException and re-throw wrapped in an IOException.
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

James Miller commented on HTTPCLIENT-1157:
------------------------------------------

@Jon: I started out that way, but I felt that all the try..catch blocks distracted from actual cache logic. I can update the patch if you feel that is cleaner.
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Oleg Kalnichevski commented on HTTPCLIENT-1157:
-----------------------------------------------

@Jon
The latest changes in SVN trunk introduced dependency on a Java 1.6 specific IOexception constructor, which broke the build

https://builds.apache.org/job/HttpComponents%20Client/402/console

We need to keep HttpClient Java 1.5 compatible, at least for now.

Oleg
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

James Miller updated HTTPCLIENT-1157:
-------------------------------------

    Attachment: httpclient-1157-2.patch

Here is an updated patch that only wraps the MemcachedClientIF methods that throw a OperationTimeoutException in a try..catch and throws an IOException instead
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Jon Moore commented on HTTPCLIENT-1157:
---------------------------------------

@James: yes, I think just putting the try...catch around the Memcached operations would be overall simpler. If you can update the patch I'd be happy to apply it.
                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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-1157) MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions

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

Jon Moore commented on HTTPCLIENT-1157:
---------------------------------------

Also agreed -- my bad. I'll fix it when I get into the office this morning. Where is our virtual collection jar so I can put my $1 in for breaking the build? :)


                
> MemcachedHttpCacheStorage should throw IOExceptions instead of Runtime Exceptions
> ---------------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-1157
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1157
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: Cache
>    Affects Versions: 4.2 Alpha1
>            Reporter: James Miller
>            Assignee: Jon Moore
>              Labels: cache
>             Fix For: 4.1.3, 4.2 Alpha2
>
>         Attachments: HTTPCLIENT-1157.patch, httpclient-1157-2.patch
>
>
> The MemcachedHttpCacheStorage class implements HttpCacheStorage which defines that methods will throw IOExceptions, but the underlying net.spy.memcached.MemcachedClientIF throws runtime exceptions. These exceptions are not caught in the code where IOExceptions are expected causing these exception bubble up to the calling code. It seems like the MemcachedHttpCacheStorage class should treat at least some of these runtime exceptions as IOExceptions so that normal code execution paths can be followed.  
> I'm proposing that MemcachedHttpCacheStorage treat a OperationTimeoutException from the memcached client as an IOException. This would allow the existing CachingHttpClient code to catch and log the exception as a warning, instead of bubbling the exception up the calling code.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
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