Summary:ASTERISK-03185: [PATCH] Asterisk crashes when accessing simultanously the mysql module
Reporter:georg (georg)Labels:
Date Opened:2005-01-05 05:08:56.000-0600Date Closed:2005-01-08 15:53:05.000-0600
Versions:Frequency of
Environment:Attachments:( 0) res_config_mysql.patch
Description:When more than 1 call-setup requires simultaneous access to the realtime mysql module (for the extensions table) asterisk crashes.
The machine is a Athlon64 with Fedora Core 3, mysql is version 3.23.58.
We tried this by generating a lot of calls copying files in outgoing and calling a realtime extension using the same machine with a TE405 configured with 2 spans as a outgoing group and 2 spans as a incoming group (2-2 bridged).


All the query stuff is protected by a mutex but the "reconnect" function can be called simutanously causing global data inconsistence. It's the case of the variable "connected" and the MYSQL object.
The patch puts the reconnect code into a mutex lock/unlock wrapper.
Comments:By: Clod Patry (junky) 2005-01-05 06:39:24.000-0600

Do you have disclaimer on file?

By: amzaka (amzaka) 2005-01-05 07:34:05.000-0600

I have noticed the same bug as well. When you make call from two phones using realtime extenions asterisk some gets stuck and does not make the calls. I will try your patch and see whether it would solve the problem or not.

By: Mark Spencer (markster) 2005-01-05 08:11:14.000-0600

Can you confirm that this bug does not occur with res_config_odbc?  (note: be sure to noload => res_config_mysql if you use res_config_odbc).  Thanks!

By: georg (georg) 2005-01-05 09:10:40.000-0600

Disclaimer faxed !

By: georg (georg) 2005-01-05 09:16:11.000-0600

markster: The res_config_odbc never tested for the same bug, but we have "noload=>res_config_odbc" to be sure we use res_config_mysql alone.

By: drmac (drmac) 2005-01-07 08:54:04.000-0600

wish there was some way for Mantis to send me a "hey this bug deals with your program" email.

anyway, thanks for the patch. this might a problem some other guy reported.

By: Mark Spencer (markster) 2005-01-07 14:25:04.000-0600

Added to CVS, thanks!