[Home]

Summary:ASTERISK-22687: Core Dump On DB Connection Failing with MariaDB
Reporter:JoshE (n8ideas)Labels:
Date Opened:2013-10-14 10:13:33Date Closed:2014-02-24 08:54:13.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:CDR/cdr_adaptive_odbc
Versions:11.5.1 Frequency of
Occurrence
Related
Issues:
is related toASTERISK-22563 Realtime database connections dropping
Environment:Attachments:( 0) backtrace.txt
( 1) bt.txt
Description:This issue seems to be exercised when a database connection is unavailable or unreliable.  It seems to be possible to duplicate this either on cdr_adaptive_odbc or standard realtime.

Backtrace Attached.
Comments:By: JoshE (n8ideas) 2013-10-14 10:17:06.799-0500

Backtrace here, actually.

By: Matt Jordan (mjordan) 2013-10-14 12:44:26.273-0500

Ugh. This is crashing down in {{libodbc.so}}. Can you reproduce this crash with the development library version of {{libodbc}} installed?

As it is, this may end up being a bug in {{libodbc}} as opposed to Asterisk, but it'd be good to know the state of things in {{libodbc}} so we can verify.

By: JoshE (n8ideas) 2013-10-15 11:52:58.687-0500

Hey Matt- so I think this is deja vu all over again.  I think we've actually talked about this issue, or related, before.  Yesterday, I had a fairly catastrophic hung state on a Maria cluster, which definitely left the DB in a weird spot.  When I did a "odbc show all", the boxes cored.  As you note, this is definitely a libodbc issue.  The boxes that experienced this were all CentOS 6 with an older 2.2.14 version of unixODBC installed from the package manager.

There were a couple of boxes that were running 2.3.1 and 2.3.2, and on those boxes the crash didn't happen.  Seems likely to me that this issue has been resolved.  Not sure if you actually want a work-around, or maybe just some documentation notes that there are known stability issues with unixODBC on older releases.

By: JoshE (n8ideas) 2013-10-21 09:41:17.751-0500

OK Matt-  I may need to walk this one back a bit.  I just saw another issue on this where we saw the box crash, this time running ODBC 2.3.2 and Asterisk 11.5.1.

Looks to be odbc related again.  New BT attached.  Any ideas on this?

By: JoshE (n8ideas) 2013-10-21 09:41:50.010-0500

New BT information with crash reproduced on latest ODBC driver.

By: JoshE (n8ideas) 2013-10-21 10:12:52.612-0500

Also, here's the last line of debug before the crash:

[2013-10-21 08:21:07] WARNING[31993] res_odbc.c: SQL Execute returned an error -1: 08S01: [MySQL][ODBC 5.1 Driver][mysqld-5.5.33a-MariaDB-log]Lost connection to MySQL server during query (96)

And here's my res_odbc configuration:

[fconfig]
enabled => yes
dsn => MySQL-Asterisk
username => writer
password => verysecret
pre-connect => yes
sanitysql => select 1
idlecheck => 30
share_connections => yes
connect_timeout => 2
negative_connection_cache => 300


By: Matt Jordan (mjordan) 2013-10-27 14:18:01.949-0500

I'm not really sure what the issue here would be, as it appears as if this is an error caused when we attempt to re-connect to the database. The fact that this is using the MySQL ODBC connector with MariaDB may also be causing an issue.

I'd recommend installing versions of the MySQL ODBC connector with debug symbols so you can get a full backtrace, then posting a bug report to either the MySQL bug tracker or MariaDB bug tracker. As it is, I don't think this is a bug in Asterisk.

By: JoshE (n8ideas) 2013-10-27 14:34:15.642-0500

Matt- I have repro'd this on both MySql and MariaDB.  I think this is something deeper and may be somewhat configuration related, but I can generate extremely long lockups when connections are terminated or timed out before they complete.

I suspect that what has been seen on issue ASTERISK-22563 is related to what we have going on here.

By: Rusty Newton (rnewton) 2013-11-13 09:19:58.696-0600

JoshE, are you able to reproduce the crash at will? Can you provide steps on how to do so with your configuration?

By: Rusty Newton (rnewton) 2013-12-09 18:13:44.343-0600

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines



By: Joshua C. Colp (jcolp) 2013-12-10 12:41:41.450-0600

<n8ideas> Can I get ASTERISK-22687 reopened? Just slow on getting a repro, but this can be repro'd and is serious.

By: Rusty Newton (rnewton) 2014-02-07 12:23:47.651-0600

JoshE, do you have any further information on the issue? Specifically are you able to reproduce the crash at will? Can you provide steps on how to do so with your configuration?

By: Rusty Newton (rnewton) 2014-02-24 08:54:04.324-0600

Suspended due to lack of activity. Please request a bug marshal in #asterisk-bugs on the IRC network irc.freenode.net to reopen the issue should you have the additional information requested.  Further information can be found at http://www.asterisk.org/developers/bug-guidelines