[
https://issues.apache.org/jira/browse/HTTPCORE-600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16929722#comment-16929722
]
Oleg Kalnichevski commented on HTTPCORE-600:
--------------------------------------------
[~gujunlong] When I run the test app locally I am getting
{{java.io.InterruptedIOException: Input operation aborted}} exception. Full log
attached. Please confirm that this is the same failure you are seeing. I will
be looking into this issue in the meantime.
{noformat}
java.util.concurrent.ExecutionException: javax.xml.ws.soap.SOAPFaultException:
[com.ctc.wstx.exc.WstxLazyException] Input operation aborted
at org.apache.cxf.endpoint.ClientCallback.get(ClientCallback.java:147)
at
org.apache.cxf.jaxws.JaxwsResponseCallback.get(JaxwsResponseCallback.java:49)
at
org.apache.cxf.AppTest.shouldNotThrowSocketTimeoutException(AppTest.java:92)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: javax.xml.ws.soap.SOAPFaultException:
[com.ctc.wstx.exc.WstxLazyException] Input operation aborted
at
org.apache.cxf.jaxws.JaxWsClientProxy.mapException(JaxWsClientProxy.java:195)
at
org.apache.cxf.jaxws.JaxWsClientProxy$1.mapThrowable(JaxWsClientProxy.java:320)
at
org.apache.cxf.jaxws.JaxwsClientCallback.handleException(JaxwsClientCallback.java:85)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:854)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1695)
at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1194)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: [com.ctc.wstx.exc.WstxLazyException]
com.ctc.wstx.exc.WstxIOException: Input operation aborted
at
com.ctc.wstx.exc.WstxLazyException.throwLazily(WstxLazyException.java:40)
at com.ctc.wstx.sr.StreamScanner.throwLazyError(StreamScanner.java:724)
at
com.ctc.wstx.sr.BasicStreamReader.safeFinishToken(BasicStreamReader.java:3758)
at
com.ctc.wstx.sr.BasicStreamReader.getTextCharacters(BasicStreamReader.java:914)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleCharacters(StAXStreamConnector.java:298)
at
com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:161)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:385)
at
com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:364)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.doUnmarshal(JAXBEncoderDecoder.java:887)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.access$200(JAXBEncoderDecoder.java:103)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder$3.run(JAXBEncoderDecoder.java:926)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:924)
at
org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:744)
at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:172)
at
org.apache.cxf.wsdl.interceptors.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:194)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:805)
... 5 more
Caused by: com.ctc.wstx.exc.WstxIOException: Input operation aborted
at
com.ctc.wstx.sr.StreamScanner.constructFromIOE(StreamScanner.java:640)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:1004)
at
com.ctc.wstx.sr.BasicStreamReader.readTextSecondary(BasicStreamReader.java:4729)
at
com.ctc.wstx.sr.BasicStreamReader.finishToken(BasicStreamReader.java:3802)
at
com.ctc.wstx.sr.BasicStreamReader.safeFinishToken(BasicStreamReader.java:3756)
... 20 more
Caused by: java.io.InterruptedIOException: Input operation aborted
at
org.apache.cxf.transport.http.asyncclient.SharedInputBuffer.waitForData(SharedInputBuffer.java:183)
at
org.apache.cxf.transport.http.asyncclient.SharedInputBuffer.read(SharedInputBuffer.java:262)
at
org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit$AsyncWrappedOutputStream$6.read(AsyncHTTPConduit.java:678)
at com.ctc.wstx.io.BaseReader.readBytes(BaseReader.java:155)
at com.ctc.wstx.io.UTF8Reader.loadMore(UTF8Reader.java:369)
at com.ctc.wstx.io.UTF8Reader.read(UTF8Reader.java:112)
at com.ctc.wstx.io.MergedReader.read(MergedReader.java:104)
at com.ctc.wstx.io.ReaderSource.readInto(ReaderSource.java:89)
at
com.ctc.wstx.io.BranchingReaderSource.readInto(BranchingReaderSource.java:57)
at com.ctc.wstx.sr.StreamScanner.loadMore(StreamScanner.java:998)
... 23 more
{noformat}
> SocketTimeoutException when remote server closes connection after payload has
> been delivered
> --------------------------------------------------------------------------------------------
>
> Key: HTTPCORE-600
> URL: https://issues.apache.org/jira/browse/HTTPCORE-600
> Project: HttpComponents HttpCore
> Issue Type: Bug
> Components: HttpCore NIO
> Affects Versions: 4.4.10, 4.4.11, 4.4.12
> Reporter: Brian B
> Assignee: Oleg Kalnichevski
> Priority: Major
> Attachments: asyncbugtest.log, asyncbugtest.zip
>
>
> Initially I created this under CXF (CXF-8113), but I think the consensus is
> it is an NIO issue. The description from that Jira edited to remove
> CXF-specific changes:
> When using the Asynchronous Client HTTP Transport to handle soap web
> services, we get a SocketTimeout exception when a remote server closes the
> connection after the payload has been delivered.
> The problem occurs when the client receives a TLS {{close_notify}} _after_
> the payload has been received. The payload must be larger than the allocated
> byte buffer receiving the decrypted payload (~16K in the default case). This
> results in decrypted data being available in the {{httpcore-nio}} library,
> but not immediately consumed.
> When these conditions are met, the following section of code is invoked:
>
> {{org.apache.cxf.transport.http.asyncclient.SharedInputBuffer#_consumeContent_:{color:#0747a6}111{color}}}:
> {code:java}
> if (!this.buffer.hasRemaining() && this.ioctrl != null && !this.endOfStream) {
> this.ioctrl.suspendInput();
> }
> {code}
> The suspension of input when combined with the connection close and the
> following change introduced in {{httpcore-nio}} 4.4.10 (and it's revised
> 4.4.11 version here) truly removes the {{READ}} {{EventMask}} from the
> underlying {{IOSessionImpl}}:
>
> {{org.apache.http.nio.reactor.ssl.SSLIOSession#_updateEventMask_:{color:#0747a6}402{color}}}
> {code:java}
> if (this.endOfStream && (this.appBufferStatus == null ||
> !this.appBufferStatus.hasBufferedInput())) {
> newMask = newMask & ~EventMask.READ;
> }
> {code}
> Once this happens, requests for input by
> {{SharedInputBuffer#_waitForData(int)_}} enter the {{_updateEventMask_}}
> method as expected, but the new {{httpcore-nio}} code above prevents the read
> operation from being reenabled despite the remainder of the decrypted payload
> being available in the {{SSLIOSession}} {{inPlain}} buffer. The call
> ultimately fails with a {{SocketTimeoutException}}.
> I created a unit test to demonstrate the failure and attached it to the JIRA.
> Given the complexity of the code and multiple buffers at play, I have not
> been able to come up with a fix beyond modifying the {{SSLIOSession}} code
> above to account for the buffered decrypted content. It seems in all cases
> where {{appBufferStatus.hasBufferedInput()}} is queried,
> {{inPlain.hasData()}} is also queried, with the exception of the
> {{updateEventMask}} code above.
> Please let me know if there's anything else you need from me.
>
--
This message was sent by Atlassian Jira
(v8.3.2#803003)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]