HTTPClientRA waits too long when trying to connecto to a non existing URL

46 views
Skip to first unread message

ionut.andras

unread,
Aug 26, 2011, 4:49:11 AM8/26/11
to mobicent...@googlegroups.com
Hi,

I have the following problem:

1. I'm trying to connect to a non existing url using the code from HTTPClientRA manual
2. Please observe the timing in error even if I set httpMethod.getParams().setSoTimeout(500):


09:28:03,157 INFO  [STDOUT] [95c8a4250a6fb3eaf0d2b7be44c5b4da]Waiting for WS ...
09:31:12,332 INFO  [HttpMethodDirector] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
09:31:12,334 INFO  [HttpMethodDirector] Retrying request
09:34:21,335 INFO  [HttpMethodDirector] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
09:34:21,335 INFO  [HttpMethodDirector] Retrying request
09:37:30,336 INFO  [HttpMethodDirector] I/O exception (java.net.ConnectException) caught when processing request: Connection timed out
09:37:30,336 INFO  [HttpMethodDirector] Retrying request
09:40:39,408 ERROR [HttpClientResourceAdaptor] executeMethod failed in AsyncExecuteHttpMethodHandler with IOException
java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
        at java.net.Socket.connect(Socket.java:529)
        at java.net.Socket.connect(Socket.java:478)
        at java.net.Socket.<init>(Socket.java:375)
        at java.net.Socket.<init>(Socket.java:249)
        at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
        at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
        at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
        at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.mobicents.client.slee.resource.http.HttpClientResourceAdaptor$AsyncExecuteMethodHandler.run(HttpClientResourceAdaptor.java:374)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
09:40:39,412 INFO  [HttpClientResourceAdaptor] ==== FIRING ResponseEvent EVENT TO LOCAL SLEE, Event: net.java.client.slee.resource.http.event.ResponseEvent@2f379c5c ====
09:40:39,429 INFO  [STDOUT] [cf4ae10abc3948cf422389ce93e37a91]Returning with status: 0


Anyone have any ideea?
Thanks

Eduardo Martins

unread,
Aug 26, 2011, 7:27:34 AM8/26/11
to mobicent...@googlegroups.com
Is that on a request after some, even if short, idle time?

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco

ionut.andras

unread,
Aug 26, 2011, 8:27:57 AM8/26/11
to mobicent...@googlegroups.com
This is the first requiest I'm doing to the server , after mobicents starts. And it waits a very long time even if the WS
not exists and it should return after timeout which is 500ms.

There is no activity before this call. Everything is clean.

Thanks for your interest.

Eduardo Martins

unread,
Aug 26, 2011, 9:36:10 AM8/26/11
to mobicent...@googlegroups.com
I recall having such issue with XCAP, will investigate what was the
solution applied to the http client.

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco

ionut.andras

unread,
Aug 26, 2011, 9:44:12 AM8/26/11
to mobicent...@googlegroups.com
Thanks a lot for the interest

Eduardo Martins

unread,
Aug 29, 2011, 10:56:56 AM8/29/11
to mobicent...@googlegroups.com
The HTTP Client RA in the trunk (please update svn) has no such issue,
I've tried the example in the svn (also updated) with a delay of 1h
and works fine.

Regarding the new RA code please note that the ra, ra type and event
versions, needed in sbb xml descriptors, went up to 4.0, to note the
migration to Apache HTTP Client 4.x.

The RA docs are also updated, you can build it from the svn by doing
"mvn install" in the HTTP Client RA docs dir, the output will be in
inside jdocbook-mobicents/target/publish/...

-- Eduardo
..............................................
http://emmartins.blogspot.com
http://redhat.com/solutions/telco

ionut.andras

unread,
Aug 29, 2011, 11:47:44 AM8/29/11
to mobicent...@googlegroups.com
Thanks you very much for the answer
Reply all
Reply to author
Forward
0 new messages