[asterisk-bugs] [JIRA] (ASTERISK-25891) Crash using ODBC in mysql with heavy usage

Carlos Oliva (JIRA) noreply at issues.asterisk.org
Thu Apr 14 05:35:57 CDT 2016


    [ https://issues.asterisk.org/jira/browse/ASTERISK-25891?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=230246#comment-230246 ] 

Carlos Oliva commented on ASTERISK-25891:
-----------------------------------------

Using latest mysql odbc connectors asterisk still crash sometimes but with less frequency. Now I'm testing with latest unixODBC. Latest version is 2.3.4 and Debian Jessie has 2.3.1

With latest unixODBC I didn't see crashes after 1 day, good news I'll test for some days more.

here is a little howto installl latest unixODBC, latest mysql connector and configure odbc connections. 

@Rusty Newton, if you think is appropriate fell free to copy and paste this to the wiki but please allow me some days more to test. 

1st be sure to not have debian versions installed:
#apt-get purge unixodbc-dev unixodbc odbcinst1debian2 odbcinst libodbc1 libmyodbc
 
get unixODBC from ftp://ftp.unixodbc.org/pub/unixODBC/unixODBC-2.3.4.tar.gz
decompress, configure, compile and install unixODBC

#./configure --prefix=/ --includedir=/usr/include
#make
#make install

Now install latest mysql connector from mysql:

download last odbc connector from: https://dev.mysql.com/downloads/connector/odbc/
decompress and copy files to a logic location for example:
tar -zxvf mysql-connector-odbc-5.3.6-linux-debian8-x86-64bit.tar.gz
cd mysql-connector-odbc-5.3.6-linux-debian8-x86-64bit
mkdir /usr/local/lib/mysql-connector-odbc-5.3.6
cp lib/*.so /usr/local/lib/mysql-connector-odbc-5.3.6/

Now configure unixODBC. According to docs in 13.8.0 version pooling in odbc is recommended. Here is an example of odbc config using pooling for mysql:

/etc/odbcinst.ini:
[MySQL]

Description = ODBC for MySQL
Driver = /usr/local/lib/mysql-connector-odbc-5.3.6/libmyodbc5w.so
Setup  = /usr/local/lib/mysql-connector-odbc-5.3.6/libmyodbc5S.so
FileUsage = 1
Pooling = Yes

 /etc/odbc.ini:
[DBCON]
Description    = Connection to database
Driver         = MySQL
Database       = myDB
Server         = mySQLIPAddress
user           = myUser
Password       = myPassword
Port           = 3306
CPTimeout      = 120
OPTION         = 3

Now recompile and install asterisk using this new headers (use --with-unixodbc in configure)



> Crash using ODBC in mysql with heavy usage
> ------------------------------------------
>
>                 Key: ASTERISK-25891
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25891
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_odbc
>    Affects Versions: 13.8.0
>         Environment: debian jessie 8.4 (KVM virtual machine)
>            Reporter: Carlos Oliva
>            Assignee: Carlos Oliva
>         Attachments: backtrace1.txt, backtrace2.txt, backtrace3.txt, bt_libmysql5_7.txt
>
>
> testing release 13.8.0 I found crashes making heavy use of ODBC with mysql. This issue seems to not happen in 13.7.2 release.
> We make a heavy usage of mysql using ODBC, dialplan functions and CEL. The isse seems to happen with 4 or 5 calls using queues, cel logging to mysql and lots of database calls in the dialplan.
>  I think maybe related to Change-Id: I37a84def5ea4ddf93868ce8105f39de078297fbf (res_odbc: Remove connection management) because it directly affects to odbc connection settings. 
> I will attach some backtraces where you can see clearly the issue is related to odbc and libmysqlclient.so.18



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list