cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Hestad (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CXF-6720) AbstractHTTPDestination#WrappedOutputStream.close() calls flush after close
Date Mon, 21 Dec 2015 13:41:46 GMT

     [ https://issues.apache.org/jira/browse/CXF-6720?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

John Hestad updated CXF-6720:
-----------------------------
    Description: 
Bug location: https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java#L806

ServletResponse.flushBuffer: http://grepcode.com/file/repo1.maven.org/maven2/javax.servlet/javax.servlet-api/3.1.0/javax/servlet/ServletResponse.java#ServletResponse.flushBuffer%28%29

Reading the javadoc of ServletResponse.flushBuffer, Closable and Flushable interfaces tells
me that calling flushBuffer on a ServletResponse containing a  closed stream could give an
IOException.

We have had problems with this in Liberty Profile, while using CXF together with CXF.

Background story:
1) https://github.com/javamelody/javamelody/issues/411
2) https://groups.google.com/forum/#!topic/javamelody/kX31sRTFrHE/discussion
3) http://www-01.ibm.com/support/docview.wss?uid=swg1PI46480

To make a short recap:
1) Soap-call to the service
2) Cxf calls close()  -> OutputStream closes
3) Cxf calls flushBuffer which hits JavaMelody's ServletResponse-wrapper which again calls
flush on the OutputStream
4) Ibm Liberty Profile throws an IOException telling the stream is closed.

If we exclude JavaMelody:
3) Cxf calls flushBuffer which hits Liberty Profile's ServletResponse-wrapper which checks
if the stream is already close and returns early.

Update: Added crossreference to the IBM WasDev issue: https://developer.ibm.com/answers/questions/244982/why-does-httpoutputstreamflush-when-stream-is-clos/

  was:
Bug location: https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java#L806

ServletResponse.flushBuffer: http://grepcode.com/file/repo1.maven.org/maven2/javax.servlet/javax.servlet-api/3.1.0/javax/servlet/ServletResponse.java#ServletResponse.flushBuffer%28%29

Reading the javadoc of ServletResponse.flushBuffer, Closable and Flushable interfaces tells
me that calling flushBuffer on a ServletResponse containing a  closed stream could give an
IOException.

We have had problems with this in Liberty Profile, while using CXF together with CXF.

Background story:
1) https://github.com/javamelody/javamelody/issues/411
2) https://groups.google.com/forum/#!topic/javamelody/kX31sRTFrHE/discussion
3) http://www-01.ibm.com/support/docview.wss?uid=swg1PI46480

To make a short recap:
1) Soap-call to the service
2) Cxf calls close()  -> OutputStream closes
3) Cxf calls flushBuffer which hits JavaMelody's ServletResponse-wrapper which again calls
flush on the OutputStream
4) Ibm Liberty Profile throws an IOException telling the stream is closed.

If we exclude JavaMelody:
3) Cxf calls flushBuffer which hits Liberty Profile's ServletResponse-wrapper which checks
if the stream is already close and returns early.


> AbstractHTTPDestination#WrappedOutputStream.close() calls flush after close
> ---------------------------------------------------------------------------
>
>                 Key: CXF-6720
>                 URL: https://issues.apache.org/jira/browse/CXF-6720
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.7.18, 3.0.7, 3.1.4
>         Environment: IBM Liberty Profile with CXF and JavaMelody, but this is mostly
a discussion about Servlet/Flushable-spec and flush after close.
>            Reporter: John Hestad
>            Priority: Minor
>              Labels: Closable, Flushable, IBM_JAVA, JavaMelody, LibertyProfile, OutputStream,
core, flush, flushBuffer, servlet-api
>
> Bug location: https://github.com/apache/cxf/blob/master/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java#L806
> ServletResponse.flushBuffer: http://grepcode.com/file/repo1.maven.org/maven2/javax.servlet/javax.servlet-api/3.1.0/javax/servlet/ServletResponse.java#ServletResponse.flushBuffer%28%29
> Reading the javadoc of ServletResponse.flushBuffer, Closable and Flushable interfaces
tells me that calling flushBuffer on a ServletResponse containing a  closed stream could give
an IOException.
> We have had problems with this in Liberty Profile, while using CXF together with CXF.
> Background story:
> 1) https://github.com/javamelody/javamelody/issues/411
> 2) https://groups.google.com/forum/#!topic/javamelody/kX31sRTFrHE/discussion
> 3) http://www-01.ibm.com/support/docview.wss?uid=swg1PI46480
> To make a short recap:
> 1) Soap-call to the service
> 2) Cxf calls close()  -> OutputStream closes
> 3) Cxf calls flushBuffer which hits JavaMelody's ServletResponse-wrapper which again
calls flush on the OutputStream
> 4) Ibm Liberty Profile throws an IOException telling the stream is closed.
> If we exclude JavaMelody:
> 3) Cxf calls flushBuffer which hits Liberty Profile's ServletResponse-wrapper which checks
if the stream is already close and returns early.
> Update: Added crossreference to the IBM WasDev issue: https://developer.ibm.com/answers/questions/244982/why-does-httpoutputstreamflush-when-stream-is-clos/



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

Mime
View raw message