You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Nerijus Areska <ne...@gmail.com> on 2009/05/15 10:28:56 UTC

CXF 2.2 Async calls result in deadlock or NPE

I've been playing with asynchronous calls using Future mechanism.
I use get() to lock and wait for a response, and would like to get notified,
if some specified timeout happens. Right now, 60 seconds seems to be
default, and i get some stack trace printed into log file:

2009-03-31 12:36:59,161 WARN [org.apache.cxf.transport.http.HTTPConduit] -
<Read timed out>
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)

Unfortunately get() method does not return nor throws any exception which
results in a deadlock.

I then tried invoking get(10L,TimeUnit.SECONDS). I also had to try catch
TimeoutException.
In this case method did throw an exception after 10 seconds, strange as it
seems, it was not TimeoutException, rather:

java.lang.NullPointerException
	at
org.apache.cxf.jaxws.JaxWsClientProxy$ResponseCallback.get(JaxWsClientProxy.java:348)

Am i missing something here? The only way i see now, is actually catching
this NPE, and treating as it was Timeout.
-- 
View this message in context: http://www.nabble.com/CXF-2.2-Async-calls-result-in-deadlock-or-NPE-tp23555549p23555549.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF 2.2 Async calls result in deadlock or NPE

Posted by Daniel Kulp <dk...@apache.org>.
OK.   I was able to duplicate both the hang on get() and NPE on get(timouts) 
in a testcase.   I'm testing a fix now which fixes it, but breaks several 
other tests.   Digging in to figure out if they are just issues with the tests 
or what.

Dan


On Tue May 19 2009 3:40:33 am Nerijus Areska wrote:
> 2.2.1 and 2.2.2-SNAPSHOT act the same:
>
> trying to invoke get(50L, TimeUnit.SECONDS) and catch TimeoutException now
> results in ( note this is different from 2.2 ):
>
> java.lang.NullPointerException
> 	at
> org.apache.cxf.jaxws.JaxwsResponseCallback.get(JaxwsResponseCallback.java:5
>4)
>
> trying to invoke get() still results in deadlock
>
>
> Can you confirm this is a bug?, because i don't believe i'm the only one
> dealing with timeouts during async calls..
> I will debug into this later on to find exact cause, and some workaround of
> course :)
>
> dkulp wrote:
> > Can you try with 2.2.1 and/or the latest 2.2.2-SNAPSHOT?   I think this
> > was
> > fixed.
> >
> > Dan

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog

Re: CXF 2.2 Async calls result in deadlock or NPE

Posted by Nerijus Areska <ne...@gmail.com>.
2.2.1 and 2.2.2-SNAPSHOT act the same:

trying to invoke get(50L, TimeUnit.SECONDS) and catch TimeoutException now
results in ( note this is different from 2.2 ):

java.lang.NullPointerException
	at
org.apache.cxf.jaxws.JaxwsResponseCallback.get(JaxwsResponseCallback.java:54)

trying to invoke get() still results in deadlock


Can you confirm this is a bug?, because i don't believe i'm the only one
dealing with timeouts during async calls..
I will debug into this later on to find exact cause, and some workaround of
course :)


dkulp wrote:
> 
> 
> Can you try with 2.2.1 and/or the latest 2.2.2-SNAPSHOT?   I think this
> was 
> fixed.  
> 
> Dan
> 
> 

-- 
View this message in context: http://www.nabble.com/CXF-2.2-Async-calls-result-in-deadlock-or-NPE-tp23555549p23611272.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: CXF 2.2 Async calls result in deadlock or NPE

Posted by Daniel Kulp <dk...@apache.org>.
Can you try with 2.2.1 and/or the latest 2.2.2-SNAPSHOT?   I think this was 
fixed.  

Dan


On Fri May 15 2009 4:28:56 am Nerijus Areska wrote:
> I've been playing with asynchronous calls using Future mechanism.
> I use get() to lock and wait for a response, and would like to get
> notified, if some specified timeout happens. Right now, 60 seconds seems to
> be default, and i get some stack trace printed into log file:
>
> 2009-03-31 12:36:59,161 WARN [org.apache.cxf.transport.http.HTTPConduit] -
> <Read timed out>
> java.net.SocketTimeoutException: Read timed out
>         at java.net.SocketInputStream.socketRead0(Native Method)
>
> Unfortunately get() method does not return nor throws any exception which
> results in a deadlock.
>
> I then tried invoking get(10L,TimeUnit.SECONDS). I also had to try catch
> TimeoutException.
> In this case method did throw an exception after 10 seconds, strange as it
> seems, it was not TimeoutException, rather:
>
> java.lang.NullPointerException
> 	at
> org.apache.cxf.jaxws.JaxWsClientProxy$ResponseCallback.get(JaxWsClientProxy
>.java:348)
>
> Am i missing something here? The only way i see now, is actually catching
> this NPE, and treating as it was Timeout.

-- 
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog