Hi Daniel<br><br>thanks a lot. I will certainly test it in the following days, I will post the results.<br><br>Regards<br><br>Javi<br><br><div class="gmail_quote">On Tue, Jan 11, 2011 at 11:18 PM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hello,<br>
<br>
just committed a patch on master branch that should attempt to reconnect to postgres server if the connection was lost. There are three attempts to execute the query before giving up.<br>
<br>
I have no meanings at this time to test it, if you can do it and report whether it works or not, will be appreciated. Somehow this is in between a bug and feature, since the parameter existed in the module (nameed retries), but was implemented only for DB API v2, so it can be backported to be also available for DB API v1 (which is the one used by kamailio modules right now).<br>

<br>
Thanks,<br>
Daniel<br>
<br>
On 1/4/11 5:54 PM, Alex Balashov wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
On 01/04/2011 09:46 AM, Javier Gallart wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi list<br>
<br>
we have been testing the mtree module. We do periodical reloads of the<br>
mtree table with the &quot;mi mt_reload&quot; command through xmlrpc. It works<br>
fine except when the db is restarted. If we manually restart the db and<br>
then try the mt_reload commands we get this error:<br>
Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:<br>
ERROR: db_postgres [km_dbase.c:152]: 0xa6a490 PQsendQuery Error: server<br>
closed the connection unexpectedly#012#011This probably means the server<br>
terminated abnormally#012#011before or while processing the request.#012<br>
Query: select partition,prefix,route from trees  order by partition<br>
Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:<br>
ERROR: &lt;core&gt; [db_query.c:101]: error while submitting query<br>
Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:<br>
ERROR: mtree [mtree_mod.c:622]: Error while querying db<br>
Jan  4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:<br>
ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database<br>
<br>
Is there a way to reconnect to the db before sending that command?<br>
</blockquote>
<br></div></div>
Failure to automatically reconnect to Postgres is one of the distinguishing features of db_postgres in contrast to db_mysql for the moment.<br>
<br>
</blockquote>
<br>
-- <br>
Daniel-Constantin Mierla<br>
Kamailio (OpenSER) Advanced Training<br>
Jan 24-26, 2011, Irvine, CA, USA<br>
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
<br>
</blockquote></div><br>