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

Sergey Beryozkin commented on CXF-7116:
---------------------------------------

I've added a single synchronization block which fixes the issue. It is quite 
hard to identify why exactly it is happening in case of the embedded Jetty 
transport. I can only think of the spurious retries which this block protects 
again. 

FYI, in the case of using Jetty embedded transport, AsyncResponse is not 100% 
feature complete, it is not built on top of the standard AsyncContext but on 
Jetty specific Continuation API, and  multiple timeouts (something one can do 
with JAX-RS 2.0 TimeoutHandler) do not work in this case, Jetty would throw the 
exceptions (see CXF JettyContinuationWrapper.reset()) - but admittedly multiple 
timeouts is not a mainstream case.

Please give 3.1.9-SNAPSHOT a try next week

> AsyncResponse.resume() infinitely hangs up after first call
> -----------------------------------------------------------
>
>                 Key: CXF-7116
>                 URL: https://issues.apache.org/jira/browse/CXF-7116
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.8
>         Environment: * Java - 1.8.0_66 (build 1.8.0_66-b17)
> * CXF - 3.1.8
> * Jetty - 9.3.13.v20161014
> * OS - OS X El Capitan 10.11.6
>            Reporter: Dmytro Khrystiuk
>              Labels: async
>             Fix For: 3.2.0, 3.1.9, 3.0.12
>
>         Attachments: cxf-issue.zip
>
>
> Issue with AsyncResponse happened after upgrade from CXF 3.1.7 to 3.1.8.
> After the second call to REST method server stops to respond. Implementation 
> of method uses AsyncResponse and call to resume() in a separate thread:
>     @GET
>     @Produces(MediaType.TEXT_PLAIN)
>     @Path("/doesNotWork")
>     public void doesNotWork(@Suspended AsyncResponse response) {
>         executorService.submit(() -> {
>             LOGGER.debug("Async task...");
>             response.resume("Success!");
>         });
>     }
> First call to method above works as it should but subsequent calls just hangs 
> up forever. No thread deadlocks were detected.
> The example test (Maven project) is attached to this item.



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

Reply via email to