You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Marnix Klooster (JIRA)" <ji...@apache.org> on 2014/11/20 13:42:34 UTC

[jira] [Comment Edited] (CXF-1819) Make PhaseInterceptorChain.unwind() more defensive wrt handleFault() exceptions

    [ https://issues.apache.org/jira/browse/CXF-1819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14219319#comment-14219319 ] 

Marnix Klooster edited comment on CXF-1819 at 11/20/14 12:41 PM:
-----------------------------------------------------------------

@[~dkulp]: Please note that this added robustness has disappeared again, since r764781 / [git commit 60c8f64...| https://fisheye6.atlassian.com/changelog/cxf?cs=60c8f64356b9f517909d422175ba0e1f414f9f5d ] from April 14, 2009 by [~sergeyb] (and/or [~sergey_beryozkin]) in https://svn.apache.org/repos/asf/cxf/tags/cxf-2.7.5/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java, as we found out the hard way.

Personally, I think that the robustness should be there.  If not, then I would expect at least a note in the JavaDoc of {{Interceptor#handleFault()}}, saying that this method MUST NOT throw an exception...

What happened to us, is that in some scenarios we DID throw an exception, the {{unwind()}} did not complete, and the rather large request remained in {{MAPCodec#uncorrelatedExchanges}} leading to an out-of-memory condition, just like in CXF-2591...

What do you think?

Thanks!


was (Author: marnix.klooster):
@[~dkulp]: Please note that this added robustness has disappeared again, since r764781 from April 14, 2009 by [~sergeyb] (and/or [~sergey_beryozkin]) in https://svn.apache.org/repos/asf/cxf/tags/cxf-2.7.5/api/src/main/java/org/apache/cxf/phase/PhaseInterceptorChain.java, as we found out the hard way.

Personally, I think that the robustness should be there.  If not, then I would expect at least a note in the JavaDoc of {{Interceptor#handleFault()}}, saying that this method MUST NOT throw an exception...

What happened to us, is that in some scenarios we DID throw an exception, the {{unwind()}} did not complete, and the rather large request remained in {{MAPCodec#uncorrelatedExchanges}} leading to an out-of-memory condition, just like in CXF-2591...

What do you think?

Thanks!

> Make PhaseInterceptorChain.unwind() more defensive wrt handleFault() exceptions
> -------------------------------------------------------------------------------
>
>                 Key: CXF-1819
>                 URL: https://issues.apache.org/jira/browse/CXF-1819
>             Project: CXF
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.1.1
>            Reporter: Mike Quilleash
>            Assignee: Daniel Kulp
>             Fix For: 2.0.10, 2.1.4
>
>
> Currently the PhaseInterceptorChain.unwind() method looks like this (logging omitted)
>         while (iterator.hasPrevious()) {
>             Interceptor currentInterceptor = iterator.previous();
>             currentInterceptor.handleFault(message);
>         }
> It would be better to defend against an exception in handleFault() as currently an exception thrown from a handleFault() stops the unwind.
> New proposed code...
>         while (iterator.hasPrevious()) {
>             Interceptor currentInterceptor = iterator.previous();
>             try {
>                 currentInterceptor.handleFault(message);
>             catch (Exception e) {
>                 LOG.log( Level.ERROR, "Exception in handleFault on interceptor " + currentInterceptor, e);
>              }
>         }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)