<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>Hello koce!<br>
<br>
Most likely, the issue is due to your restricting
"connection_timeout = 1" module parameter. To quote from libcurl's
documentation [1]: <i>"You must not wait too long (more than a
few seconds perhaps)". </i>This is why I chose that 500 ms
pause time upon running into that error condition, which is
basically 50% of your allowed blocking time already!<br>
<br>
To better understand how much libcurl expects you to wait, you can
apply an extra logging patch:<br>
<br>
<i>git apply <(wget -qO -
<a class="moz-txt-link-freetext" href="http://opensips.org/patches/rest_client_connect_timeout_logging.patch">http://opensips.org/patches/rest_client_connect_timeout_logging.patch</a>)<br>
<br>
</i>Please re-compile your rest_client and re-run the test, and
we'll draw final conclusions afterwards!<br>
<br>
[1]: <a class="moz-txt-link-freetext" href="https://curl.haxx.se/libcurl/c/curl_multi_timeout.html">https://curl.haxx.se/libcurl/c/curl_multi_timeout.html</a><br>
<br>
Best regards,<br>
</tt>
<pre class="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 23.02.2016 15:46,
<a class="moz-txt-link-abbreviated" href="mailto:koce@mentalchallenge.tk">koce@mentalchallenge.tk</a> wrote:<br>
</div>
<blockquote cite="mid:56CC6298.8060102@mentalchallenge.tk"
type="cite">Hello I'm using OpenSIPS 2.1 latest from git and every
time I call the first async(rest_post) function from my script I
experience timeout,and the other calls to async(rest_post) after
that point in the script are OK, as if the first call is like a
ping to the http server it does not send any data to it,it only
completes the TCP handshake.
<br>
But if I put a dummy rest_post() function in front of the first
async(rest_post) it will send the data that is assigned to it and
after that the first async(rest_post) call and the rest that
follow will execute as planned.
<br>
To test if there is something wrong with the server that I'm
connecting to I tried another server that had nothing to do with
the original just to see if I get the same result and YES the
async(rest_post) to that server failed but the other
async(rest_post) who are interacting with the original server
executed without a hitch.
<br>
Also I think it's related to this
<a class="moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/issues/493">https://github.com/OpenSIPS/opensips/issues/493</a> which is closed.
<br>
Could this be a possible bug,or am I missing something obvious ?
<br>
Also I installed curl 7.47.1 just to make sure it wasn't libcurl
in question and the same scenario happened again.
<br>
the errors that I got in opensips.log
<br>
====================
<br>
Feb 23 10:49:43 /sbin/opensips[25985]:
<a class="moz-txt-link-freetext" href="INFO:rest_client:start_async_http_req">INFO:rest_client:start_async_http_req</a>: curl_multi_timeout()
returned -1, pausing 500ms...
<br>
Feb 23 10:49:44 /sbin/opensips[25985]:
ERROR:rest_client:start_async_http_req: timeout while connecting
to '<a class="moz-txt-link-freetext" href="http://192.168.100.3:2080/jsonrpc">http://192.168.100.3:2080/jsonrpc</a>' (1 sec)
<br>
====================
<br>
Feb 23 12:28:08 /sbin/opensips[26219]:
<a class="moz-txt-link-freetext" href="INFO:rest_client:start_async_http_req">INFO:rest_client:start_async_http_req</a>: curl_multi_timeout()
returned -1, pausing 500ms...
<br>
Feb 23 12:28:08 /sbin/opensips[26219]:
ERROR:rest_client:start_async_http_req: timeout while connecting
to '<a class="moz-txt-link-freetext" href="http://192.168.100.2:80/jsonrpc">http://192.168.100.2:80/jsonrpc</a>' (1 sec)
<br>
====================
<br>
NOTE: the IP's are substituted from the real ones which are
public.
<br>
I'm attaching 2 flows from wireshark.
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>