cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ffang <freeman.f...@gmail.com>
Subject Re: receiveTimeout ignored since 3.1.9?
Date Sat, 14 Jan 2017 01:51:10 GMT
Hi Veit,

I revise the testcase a little bit to verify the receiveTimeout < 1000ms also take effect[1]

Anyway, I think you can create a jira ticket and attach your testcase there(you can’t send
attachment through this maillinglist), we can continue discussion in that jira ticket

[1]http://git-wip-us.apache.org/repos/asf/cxf/commit/ae83629e <http://git-wip-us.apache.org/repos/asf/cxf/commit/ae83629e>

-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat



> On Jan 13, 2017, at 10:41 PM, Veit Guna <Veit.Guna@gmx.de> wrote:
> 
> Hi guys.
> 
> I found the cause. It seems that requests, that take less than 1000ms to respond, aren't
covered by the receiveTimeout.
> That means if I set the receiveTimeout to 1ms, and perform a request that only takes
500ms, the call succeeds. If I do the same
> with a request that takes 2000ms, it fails with a ProcessingException. With 3.1.8 it
also failed with requests < 1000ms.
> 
> One could argue though, that in most cases it doesn't make sense to set a receiveTimeout
< 1s. In my case it's only within
> a testcase. So you can decide whether this is a bug, or just an undocumented behavior
:).
> 
> I have a testcase - if you're still interested. Just give me a note and I create a Bug|Improvement|You
name it.
> 
> Thanks
> Veit
> 
> 
>> Gesendet: Freitag, 13. Januar 2017 um 11:02 Uhr
>> Von: "Sergey Beryozkin" <sberyozkin@gmail.com>
>> An: ffang <freeman.fang@gmail.com>
>> Cc: users@cxf.apache.org, ffang@apache.org
>> Betreff: Re: receiveTimeout ignored since 3.1.9?
>> 
>> Hi Freeman, thanks...
>> On 13/01/17 04:14, ffang wrote:
>>> Hi Sergey,
>>> 
>>> Thanks, and just add a test in JAXRSAsyncClientTest to verify the
>>> receiveTimeout configuration works for the jaxrs async invocation with
>>> ahc[1]
>>> 
>>> [1]http://git-wip-us.apache.org/repos/asf/cxf/commit/17c7ebc8
>>> 
>>> Hi Veit,
>>> 
>>> Could you please provide a runnable testcase as we can’t reproduce this
>>> on our side. You can create a jira ticket and attach your testcase there.
>>> 
>>> Thanks
>>> -------------
>>> Freeman(Yue) Fang
>>> 
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> 
>>> 
>>> 
>>>> On Jan 12, 2017, at 9:52 PM, Sergey Beryozkin <sberyozkin@gmail.com
>>>> <mailto:sberyozkin@gmail.com>> wrote:
>>>> 
>>>> Hi Freeman, thanks, try either JAXWS or JAXRS end to end system sync
>>>> test (ex, JAXRSAsyncClientTest) where a 'use.async.conduit' is set as
>>>> a property
>>>> 
>>>> Cheers, Sergey
>>>> On 12/01/17 13:46, Freeman Fang wrote:
>>>>> Hi Sergey,
>>>>> 
>>>>> With  CXF-7122, we found that with ahc 4.1.0 afterwards, the
>>>>> ReceivedTimeout we set on ahc RequestConfig won't affect the connection
>>>>> return to the pool, so that the connection could be actually reused.
So
>>>>> that CXF can rely on ahc to manage the ReceivedTimeout and don’t need
>>>>> that TimeoutThread(Timer) in CXF, so we remove that Timer in CXF-7122.
>>>>> 
>>>>> And we actually have AsyncHTTPConduitTest#testTimeout
>>>>> and AsyncHTTPConduitTest#testTimeoutAsync to cover both the sync and
>>>>> async calls
>>>>> 
>>>>> @Test
>>>>>   public void testTimeout() throws Exception {
>>>>>       updateAddressPort(g, PORT);
>>>>>       HTTPConduit c =
>>>>> (HTTPConduit)ClientProxy.getClient(g).getConduit();
>>>>>       c.getClient().setReceiveTimeout(3000);
>>>>>       try {
>>>>>           assertEquals("Hello " + request, g.greetMeLater(-5000));
>>>>>           fail();
>>>>>       } catch (Exception ex) {
>>>>>           //expected!!!
>>>>>       }
>>>>>   }
>>>>> 
>>>>>   @Test
>>>>>   public void testTimeoutAsync() throws Exception {
>>>>>       updateAddressPort(g, PORT);
>>>>>       HTTPConduit c =
>>>>> (HTTPConduit)ClientProxy.getClient(g).getConduit();
>>>>>       c.getClient().setReceiveTimeout(3000);
>>>>>       try {
>>>>>           Response<GreetMeLaterResponse> future =
>>>>> g.greetMeLaterAsync(-5000L);
>>>>>           future.get();
>>>>>           fail();
>>>>>       } catch (Exception ex) {
>>>>>           //expected!!!
>>>>>       }
>>>>>   }
>>>>> 
>>>>> Not sure what’s the real problem Veit run into, I will try to reproduce
>>>>> the error.
>>>>> -------------
>>>>> Freeman(Yue) Fang
>>>>> 
>>>>> Red Hat, Inc.
>>>>> FuseSource is now part of Red Hat
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Jan 12, 2017, at 8:42 PM, Sergey Beryozkin <sberyozkin@gmail.com
>>>>>> <mailto:sberyozkin@gmail.com>
>>>>>> <mailto:sberyozkin@gmail.com>> wrote:
>>>>>> 
>>>>>> Hi Veit,
>>>>>> 
>>>>>> I recall there was another update related to introducing a
>>>>>> TimeoutThread, the async conduit was ignoring the receiveTimeout
for
>>>>>> the async calls.
>>>>>> 
>>>>>> Hi Freeman, looks like that change affected the use of the async
>>>>>> conduit for the sync calls (this would affect both JAXWS & JAXRS),
can
>>>>>> you double check please
>>>>>> 
>>>>>> Thanks, Sergey
>>>>>> 
>>>>>> 
>>>>>> On 03/01/17 17:09, Veit Guna wrote:
>>>>>>> Hi.
>>>>>>> 
>>>>>>> I just upgraded from 3.1.8 to 3.1.9 with the effect, that one
of my
>>>>>>> tests is failing now regarding the receiveTimeout set on
>>>>>>> HTTPClientPolicy.
>>>>>>> I'm currently using CXF for JAX-RS client side proxy generation
>>>>>>> based on
>>>>>>> my REST server interfaces. I'm also using the "use.async.http.conduit"
>>>>>>> switch
>>>>>>> to use the async http conduit.
>>>>>>> 
>>>>>>> The test is setting the receiveTimeout on the HTTPClientPolicy
to 1
>>>>>>> (ms)
>>>>>>> like this:
>>>>>>> 
>>>>>>> JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();
>>>>>>> ...
>>>>>>> MyService myService = bean.create(MyService.class);
>>>>>>> ClientConfiguration clientConfig = WebClient.getConfig(myService);
>>>>>>> clientConfig.getResponseContext().put("buffer.proxy.response",
>>>>>>> cacheResponses);
>>>>>>> clientConfig.getRequestContext().put("use.async.http.conduit",
true);
>>>>>>> 
>>>>>>> HTTPClientPolicy clientPolicy =
>>>>>>> clientConfig.getHttpConduit().getClient();
>>>>>>> cllientPolicy.setReceiveTimeout(receiveTimeoutMillis);
>>>>>>> clientPolicy.setConnectionTimeout(connectionTimeoutMillis);
>>>>>>> 
>>>>>>> Then it calls a status REST endpoint and expects a ProcessingException
>>>>>>> to be thrown. But this is never thrown and the call succeeds.
>>>>>>> In the past it failed as expected. I also switched to another
endpoint
>>>>>>> that takes a bit longer to respond but with the same effect.
>>>>>>> Going back to 3.1.8 fixes the issue.
>>>>>>> 
>>>>>>> I took a look at the recent changes and found this:
>>>>>>> 
>>>>>>> https://issues.apache.org/jira/browse/CXF-7122
>>>>>>> 
>>>>>>> Maybe it is related to it?
>>>>>>> 
>>>>>>> Thanks!
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> --
>>>>>> Sergey Beryozkin
>>>>>> 
>>>>>> Talend Community Coders
>>>>>> http://coders.talend.com/
>>>>> 
>>>> 
>>>> 
>>>> --
>>>> Sergey Beryozkin
>>>> 
>>>> Talend Community Coders
>>>> http://coders.talend.com/
>>> 
>> 
>> 
>> 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message