[asterisk-bugs] [JIRA] (ASTERISK-22708) ODBC negative_connection_cache option not respected

Rusty Newton (JIRA) noreply at issues.asterisk.org
Thu Nov 14 18:42:03 CST 2013


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

Rusty Newton commented on ASTERISK-22708:
-----------------------------------------

Thanks! That does help.

Sounds like there are two problems here:

1. negative_connection_cache doesn't appear to work, or the documentation doesn't represent it's behavior correctly

2. func_odbc only appears to try connecting to your one DSN and not the second.


Regarding 1,

I may be misunderstanding how negative_connection_cache works, but it sounds like Asterisk shouldn't attempt a connection back to that same DSN again within the time frame specified.

I went ahead and set up a test and found essentially what you saw. Despite the negative_connection_cache setting, any attempts to query the database were actually attempted and of course failed because I had created a disconnected scenario.

Based on the sample file description of the negative_connection_cache and the description here: http://www.mail-archive.com/asterisk-dev@lists.digium.com/msg48943.html I would have expected different behavior.

Regarding 2,

Can you attach your func_odbc.conf, or verify that you have specified the DSN's for both of your databases in the function configuration that you are using?
                
> ODBC negative_connection_cache option not respected
> ---------------------------------------------------
>
>                 Key: ASTERISK-22708
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22708
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_odbc
>    Affects Versions: 11.5.1
>         Environment: CentOS 6
>            Reporter: JoshE
>            Assignee: Rusty Newton
>         Attachments: full, odbc_errors.txt
>
>
> The database failover behavior does not work as expected with MySQL / MariaDB on the databases.  Based on a reading of the documentation and source, I would expect this config in res_odbc to behave differently than it does:
> [config]
> enabled => yes
> dsn => MySQL
> username => user
> password => hidden
> pre-connect => yes
> sanitysql => select 1
> idlecheck => 30
> share_connections => yes
> connect_timeout => 2
> negative_connection_cache => 300
> [config_2]
> enabled => yes
> dsn => MySQL-2
> username => user
> password => hidden
> pre-connect => yes
> sanitysql => select 1
> idlecheck => 30
> share_connections => yes
> connect_timeout => 2
> negative_connection_cache => 300
> Based on my reading, a connect timeout getting hit should cause a negative cache where new connections are not attempted for 300 seconds.  That does not occur in practice.  The server continually attempts to reconnect to the server, meanwhile the entire system becomes totally unusable until the database connection is restored.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list