You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2012/08/28 19:38:08 UTC

[jira] [Comment Edited] (CXF-4480) Client generated with "-db source" and using streaming doesn't work properly with messages > 10 kb

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

Daniel Kulp edited comment on CXF-4480 at 8/29/12 4:37 AM:
-----------------------------------------------------------

This is a problem with the testcase, not CXF.   The testcase is sending and then receiving a Source object, but it is not making any attempt to "read" the source object on the client side.   The server is trying to stream the data back to the client and is waiting for the client to "read" some data so it can send more.  Eventually, all the server threads fill up trying to send the data and the client starts getting errors.  If you wait long enough, the server threads will start timing out and recover.   I believe the limit is either 8K or 16K and not 10K as that would be the default buffer size on the Jetty side.

If you change the RunnableTest code to:
{code}
Source source = new SAXSource(new InputSource(new ByteArrayInputStream(message)));
Holder<Source> s = new Holder<Source>(source);
client.requestResponse(s);
if (i % 100 == 0) {
    System.out.print(".");
}
if (s.value instanceof SAXSource) {
    XMLReader reader = ((SAXSource)s.value).getXMLReader();
    reader.setContentHandler(new DefaultHandler());
    reader.parse((String)null);
}
{code} 

it behaves much better.
                
      was (Author: dkulp):
    
This is a problem with the testcase, not CXF.   The testcase is sending and then receiving a Source object, but it is not making any attempt to "read" the source object on the client side.   The server is trying to stream the data back to the client and is waiting for the client to "read" some data so it can send more.  Eventually, all the server threads fill up trying to send the data and the client starts getting errors.  If you wait long enough, the server threads will start timing out and recover.   I believe the limit is either 8K or 16K and not 10K as that would be the default buffer size on the Jetty side.

If you change the RunnableTest code to:
{code}
Source source = new SAXSource(new InputSource(new ByteArrayInputStream(message)));
				Holder<Source> s = new Holder<Source>(source);
				client.requestResponse(s);
				if (i % 100 == 0) {
					System.out.print(".");
				}
				if (s.value instanceof SAXSource) {
				    XMLReader reader = ((SAXSource)s.value).getXMLReader();
				    reader.setContentHandler(new DefaultHandler());
				    reader.parse((String)null);
				}
{code} 

it behaves much better.
                  
> Client generated with "-db source" and using streaming doesn't work properly with messages > 10 kb
> --------------------------------------------------------------------------------------------------
>
>                 Key: CXF-4480
>                 URL: https://issues.apache.org/jira/browse/CXF-4480
>             Project: CXF
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.6
>            Reporter: Andrei Shakirin
>            Assignee: Daniel Kulp
>            Priority: Critical
>             Fix For: Invalid
>
>         Attachments: stream.zip
>
>
> Use case: client is generated from WSDL using -db source option and uses streaming to send message payload concurrently. Service is implemented using Provider<> interface and just redirects incoming request to response.
> Test results:
> 1. Combination works fine if message size is 1 KB. Client succesfully runs in single thread and in concurrent modes.
> 2. If message size is 10 KB (or larger), after some time client becomes following exceptions:
> WARNING: Interceptor for {http://www.talend.org/benchmark}BenchmarkService#{http://www.talend.org/benchmark}requestResponse has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused by: com.ctc.wstx.exc.WstxIOException: Error writing request body to server.
> 	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:73)
> 	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:50)
> 	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:46)
> 	at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:119)
> 	at org.apache.cxf.interceptor.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> 	at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:532)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320)
> 	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89)
> 	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
> 	at $Proxy21.requestResponse(Unknown Source)
> 	at org.talend.ps.benchmark.consumer.RunnableTest.run(RunnableTest.java:30)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: com.ctc.wstx.exc.WstxIOException: Error writing request body to server
> 	at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:464)
> 	at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:551)
> 	at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:527)
> 	at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:481)
> 	at org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:70)
> 	... 16 more
> Errors occure in concurrent as well as in non-concurrent modes, but are easily reproducable in concurrent case.
> Eventually problem is related to message chunking.
> Test projects are attached.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira