Re: [SR-Users] Reconnection to db

2011-01-19 Thread Javier Gallart
Hi Daniel i just tested the new version, now the mtree module is properly loaded. Logs when the server has been stopped (fisrt attempt): r_ctl Jan 19 04:49:58 kam-test /usr/local/kamailio.20110118/sbin/kamailio[7403]: DEBUG: db_postgres [km_dbase.c:130]: connection OK Jan 19 04:49:58 kam-test /us

Re: [SR-Users] Reconnection to db

2011-01-18 Thread Daniel-Constantin Mierla
Hello, I did a new tuning, skipping reconnect in submit query if connection is ok - the result might be broken due to other reasons and will be reported when fetching it. If you can try again and report, would be appreciated. Thanks, Daniel On 1/18/11 11:34 AM, Javier Gallart wrote: Hi Da

Re: [SR-Users] Reconnection to db

2011-01-18 Thread Javier Gallart
Hi Daniel I tested the patch but the mtree module fails to start: Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: [db.c:202]: using db bind api for db_postgres Jan 18 04:15:55 kam-test ./kamailio[4616]: DEBUG: [db.c:285]: connection 0x931768 not found in pool Jan 18 04:15:55 kam-test ./kamail

Re: [SR-Users] Reconnection to db

2011-01-16 Thread Daniel-Constantin Mierla
Hello, made a commit to fix in such case, when the broken connection is reported after doing actually the query, attempting to reconnect then. Let me know if works now. Cheers, Daniel On 1/16/11 6:17 PM, Javier Gallart wrote: Hi Daniel, I'm using postgres 8.4 at the server and libpq5 libra

Re: [SR-Users] Reconnection to db

2011-01-16 Thread Javier Gallart
Hi Daniel, I'm using postgres 8.4 at the server and libpq5 library for the client. I've been testing again and the problem is that after a db restart (no matter if done through a service restart or having t down for some time), the PQstatus(CON_CONNECTION(_con)) function returns a CONNECTION_OK a

Re: [SR-Users] Reconnection to db

2011-01-14 Thread Daniel-Constantin Mierla
Hello, what version of postgres and postgres client library are you using? According to the docs from devel manual, this is the function that should be used to reconnect: |PQreset| Resets the communication channel to the server. void PQreset(PGconn *conn); This function will close

Re: [SR-Users] Reconnection to db

2011-01-14 Thread Javier Gallart
Hi Daniel this is my test: 1- Kamailio starts and correctly loads the mtree 2- I make whatever modification in the tree and reload with mt_reload Jan 14 04:19:06 kam-test ./kamailio[31205]: DEBUG: db_postgres [km_dbase.c:153]: sending query ok: 0x92f880 - [select tname,tprefix,tvalue from mtree

Re: [SR-Users] Reconnection to db

2011-01-13 Thread Daniel-Constantin Mierla
Can you send the log messages (debug=3) for that moment (restart of pg server and making a new call/registration)? Daniel On 1/13/11 12:00 PM, Javier Gallart wrote: Hi Daniel I have just tested it and I'm getting the same results. This is the kamailio version I'm testing: root@kam-test:/usr

Re: [SR-Users] Reconnection to db

2011-01-13 Thread Javier Gallart
Hi Daniel I have just tested it and I'm getting the same results. This is the kamailio version I'm testing: root@kam-test:/usr/local/kamailio/sbin# ./kamailio -V version: kamailio 3.2.0-dev2 (x86_64/linux) 35568f Thanks! Javi On Tue, Jan 4, 2011 at 3:46 PM, Javier Gallart wrote: > Hi list >

Re: [SR-Users] Reconnection to db

2011-01-12 Thread Javier Gallart
Hi Daniel thanks a lot. I will certainly test it in the following days, I will post the results. Regards Javi On Tue, Jan 11, 2011 at 11:18 PM, Daniel-Constantin Mierla < mico...@gmail.com> wrote: > Hello, > > just committed a patch on master branch that should attempt to reconnect to > postgr

Re: [SR-Users] Reconnection to db

2011-01-11 Thread Daniel-Constantin Mierla
Hello, 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. I have no meanings at this time to test it, if you can do it and report whether it works or not, will

Re: [SR-Users] Reconnection to db

2011-01-04 Thread Alex Balashov
On 01/04/2011 09:46 AM, Javier Gallart wrote: Hi list we have been testing the mtree module. We do periodical reloads of the mtree table with the "mi mt_reload" command through xmlrpc. It works fine except when the db is restarted. If we manually restart the db and then try the mt_reload command

[SR-Users] Reconnection to db

2011-01-04 Thread Javier Gallart
Hi list we have been testing the mtree module. We do periodical reloads of the mtree table with the "mi mt_reload" command through xmlrpc. It works fine except when the db is restarted. If we manually restart the db and then try the mt_reload commands we get this error: Jan 4 09:13:17 server /usr