<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<tt>Hi, Jeff!<br>
<br>
Unfortunately async operations are only supported by the MySQL
backend, therefore it won't work with unixodbc or other backends.
Now it crashes because of a mishandling in the db_virtual module.
We are working on a fix for the crash, but even after the fix, you
will still be unable to run async queries with unixodbc.<br>
If you really want to do it async, then you should use MySQL
backend. Also, don't forget to open a feature request on the
issues page[1] to support async queries for unixodbc.<br>
<br>
[1] <a class="moz-txt-link-freetext" href="https://github.com/OpenSIPS/opensips/issues">https://github.com/OpenSIPS/opensips/issues</a><br>
<br>
Best regards,<br>
</tt>
<pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 09/07/2016 04:16 AM, Jeff Pyle
wrote:<br>
</div>
<blockquote
cite="mid:D8CD6C4EB9EFE44690104CAEAB5F32D5589CB856@EX2010A.isg.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoPlainText">Hello,<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I'm working from the 2.2 nightly build
repo on Debian Jessie, 64-bit, specifically,
2.2.1~20160830~7261cf0-1.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">I have a simple test script that runs a
stored procedure on a Microsoft SQL 2014 server and xlogs the
returned AVPs. This works fine. When I break it up into an
async() function and a return route block, I get a crash every
time.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Script:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">route {<o:p></o:p></p>
<p class="MsoPlainText"> xlog("L_INFO", "Sending
query...\n");<o:p></o:p></p>
<p class="MsoPlainText"> async(avp_db_query("exec
dbo.doStuff '1','2','3','4'",<o:p></o:p></p>
<p class="MsoPlainText">
"$avp(db1);$avp(db2);$avp(db3)"), post_db_dip);<o:p></o:p></p>
<p class="MsoPlainText">}<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">route [post_db_dip] {<o:p></o:p></p>
<p class="MsoPlainText"> xlog("L_INFO", "Back
from query.\n");<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> while
(is_avp_set("$avp(db1)") && is_avp_set("$avp(db2)")
&& is_avp_set("$avp(db3)")) {<o:p></o:p></p>
<p class="MsoPlainText">
xlog("L_INFO", "db1=$avp(db1), db2=$avp(db2),
db3=$avp(db3)\n");<o:p></o:p></p>
<p class="MsoPlainText">
avp_delete("$avp(db1)");<o:p></o:p></p>
<p class="MsoPlainText">
avp_delete("$avp(db2)");<o:p></o:p></p>
<p class="MsoPlainText">
avp_delete("$avp(db3)");<o:p></o:p></p>
<p class="MsoPlainText"> }<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> xlog("L_INFO", "End of
processing.\n");<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> sl_send_reply("600",
"Road Closed");<o:p></o:p></p>
<p class="MsoPlainText"> exit;<o:p></o:p></p>
<p class="MsoPlainText">}<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The debug=6:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">...<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19887]:
DBG:avpops:ops_async_dbquery: query [exec dbo.doStuff
'1','2','3','4']<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19887]:
DBG:db_virtual:db_virtual_async_raw_query: f call handle size
= 1<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19887]:
DBG:db_virtual:try_reconnect: try reconnect<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19887]:
DBG:db_virtual:db_virtual_async_raw_query: flags1 = 3<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19883]:
DBG:core:handle_sigs: status = 11<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19883]:
<a class="moz-txt-link-freetext" href="INFO:core:handle_sigs">INFO:core:handle_sigs</a>: child process 19887 exited by a signal
11<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19883]:
<a class="moz-txt-link-freetext" href="INFO:core:handle_sigs">INFO:core:handle_sigs</a>: core was not generated<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19883]:
<a class="moz-txt-link-freetext" href="INFO:core:handle_sigs">INFO:core:handle_sigs</a>: terminating due to SIGCHLD<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19890]:
<a class="moz-txt-link-freetext" href="INFO:core:sig_usr">INFO:core:sig_usr</a>: signal 15 received<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19889]:
<a class="moz-txt-link-freetext" href="INFO:core:sig_usr">INFO:core:sig_usr</a>: signal 15 received<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19888]:
<a class="moz-txt-link-freetext" href="INFO:core:sig_usr">INFO:core:sig_usr</a>: signal 15 received<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19886]:
<a class="moz-txt-link-freetext" href="INFO:core:sig_usr">INFO:core:sig_usr</a>: signal 15 received<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19885]:
<a class="moz-txt-link-freetext" href="INFO:core:sig_usr">INFO:core:sig_usr</a>: signal 15 received<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19884]:
<a class="moz-txt-link-freetext" href="INFO:core:sig_usr">INFO:core:sig_usr</a>: signal 15 received<o:p></o:p></p>
<p class="MsoPlainText">/usr/sbin/opensips[19883]:
<a class="moz-txt-link-freetext" href="INFO:core:cleanup">INFO:core:cleanup</a>: cleanup<o:p></o:p></p>
<p class="MsoPlainText">...and so forth.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The process that crashes, 19887 in this
particular case, is a listener process. I never see the "Back
from xlog" xlog appear. OpenSIPS immediately respawns but I
suspect that's systemd.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Am I doing something wrong, or is this a
bug?<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">- Jeff<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
</div>
<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>