[Asterisk-Dev] res_config_mysql.c connection problems => bug

Loic DIDELOT ldidelot at voipgate.com
Mon Nov 28 03:33:58 MST 2005


Hello,
I attached the modified files to this e-mail and I did some more 
connection checks. To do this I played with iptables.

If I drop or reject incoming packets from the mysql server the module
does not load. I guess this is correct behaviour as the
mysql_real_connection function times out. I think this is something
difficult to reproduce in a production environnment.

If I reject outgoing packets to the mysql server, the module loads but
after the connection is restored, asterisk crashes.


Best regards,
Loic Didelot.




On Sun, 2005-11-27 at 23:17 -0300, Ariel Monaco wrote:
> I'd be interested in C code as well as helping you to submit a patch for
> making the module to load even when it cannot connect to the DB.
> 
> Maybe we could add some little humble code to make asterisk load the
> module and to make the module to (nicely) retry the connection to the
> database engine.
> 
> Thanks,
> Ariel
> ----- Original Message ----- 
> From: "Loic DIDELOT" <ldidelot at voipgate.com>
> To: "Asterisk Developers Mailing List" <asterisk-dev at lists.digium.com>
> Sent: Sunday, November 27, 2005 9:50 PM
> Subject: [Asterisk-Dev] res_config_mysql.c connection problems => bug
> 
> 
> > hello,
> > i have done some tests with asterisk realtime mysql (asterisk 1.2).
> > everything works great even under heavy load. but now i tried to
> > simulate connection problems between asterisk and the mysql server to
> > see how fast asterisk will reconnect etc...
> >
> > if asterisk can not connect to the mysql server it will not load the
> > module.
> >
> > if this is a know problem, thanks for pointing me to the solution and
> > sorry for taking your time.
> >
> > best regards,
> > loic didelot.
> >
> > ps: i am working on a patch for res_config_mysql.c to send "SELECT"
> > queries and "UPDATE" queries to 2 different servers (great for
> > master-slave database setups). i got it working, except when asterisk
> > has connection problems. just give me a sign if anyone is interested in
> > reviewing my lousy c code.
> >
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> >
> > Asterisk-Dev mailing list
> > To UNSUBSCRIBE or update options visit:
> >   http://lists.digium.com/mailman/listinfo/asterisk-dev
> >
> >
> >
> > -- 
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.1.362 / Virus Database: 267.13.7/182 - Release Date: 11/24/2005
> >
> > 
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> Asterisk-Dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: res_config_mysql.c
Type: text/x-csrc
Size: 28737 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20051128/0f2e7c97/res_config_mysql.c
-------------- next part --------------
;
; Sample configuration for res_config_mysql.c
;
; The value of dbhost may be either a hostname or an IP address.
; If dbhost is commented out or the string "localhost", a connection
; to the local host is assumed and dbsock is used instead of TCP/IP
; to connect to the server.
;
[general]
dbname = voipgate2

dbhost-read = 80.92.83.30
dbuser-read = franckdev
dbpass-read = Raifee2o
dbport-read = 3306
dbsock-read = /tmp/mysql.sock

dbhost-write = 80.92.83.32
dbuser-write = franckdev
dbpass-write = Raifee2o
dbport-write = 3306
dbsock-write = /tmp/mysql2.sock




More information about the asterisk-dev mailing list