[
https://issues.apache.org/jira/browse/CXF-7232?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18130903#comment-18130903
]
Freeman Yue Fang commented on CXF-7232:
---------------------------------------
h3. Reproducer
Please find the attached cxf-7232-reproducer.tar to reproduce this issue
An asynchronous call ({{Dispatch.invokeAsync}}) should return at once. When the
request is cached so it can be resent ({{AutoRedirect=true}}, {{MaxRetransmits
> 0}}, or an auth supplier that needs request caching),
{{HTTPConduit.WrappedOutputStream.handleResponse()}} calls
{{handleRetransmits()}} on the caller thread. {{processRetransmit()}} calls
{{getResponseCode()}}, which waits for the response, so the "async" call blocks
until the server has answered.
h4. Contents
* {{pom.xml}}: CXF 4.2.4 by default; override with {{-Dcxf.version=...}}
** default: JDK HttpClient conduit
* {{SlowSoapServer}}: a JDK {{HttpServer}}. {{/echo}} answers after 3 s;
{{/redirect}} answers at once with a 307 to {{/echo}}.
* {{AsyncRetransmitBlockingTest}} (JUnit 5): each test runs with the default
conduit and with {{force.urlconnection.http.conduit=true}}.
||Test||Request cached||Result on 4.2.4||
|noRetransmit|no|passes (baseline)|
|autoRedirectWithRedirect|yes (this issue)|fails: blocks for 3 s|
|autoRedirectWithoutRedirect|yes|fails: blocks for 3 s|
|maxRetransmits|yes|fails: blocks for 3 s|
h4. Second problem with hc and hc5
{{autoRedirectWithRedirect}} does not get a response at all. The async conduit
starts processing the response on the work queue as soon as the 307 arrives,
while the caller thread follows the redirect. The empty 307 body is parsed as
the SOAP response, which fails with an EOF and then an NPE.
h4. Results
* 4.2.4: every test that caches the request fails, with all three conduits.
h4. Running
{noformat}
mvn test # JDK HttpClient conduit
mvn test -Phc5 # HttpClient 5
mvn test -Phc # HttpAsyncClient 4
{noformat}
> Soap Async is incompatible with AutoRedirect=true
> -------------------------------------------------
>
> Key: CXF-7232
> URL: https://issues.apache.org/jira/browse/CXF-7232
> Project: CXF
> Issue Type: Bug
> Components: JAX-WS Runtime, Transports
> Affects Versions: 3.1.9
> Environment: java 8
> Reporter: Benoit Wiart
> Assignee: Freeman Yue Fang
> Priority: Major
> Attachments: cxf-7232-reproducer.tar
>
>
> When using AutoRedirect=true with cxf-rt-transports-http-hc the call is
> correctly executed asynchronously through httpasyncclient BUT the original
> thread blocks until the end of the asynchronous execution.
> Switching AutoRedirect to false make the same call fully asynchronous by
> avoiding work in
> org.apache.cxf.transport.http.HTTPConduit.WrappedOutputStream.handleRetransmits()
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)