[asterisk-bugs] [JIRA] (ASTERISK-26177) func_odbc: Database handle is kept when it should be released

Alexei Gradinari (JIRA) noreply at issues.asterisk.org
Thu Jul 7 11:06:56 CDT 2016


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

Alexei Gradinari commented on ASTERISK-26177:
---------------------------------------------

Joshua,

I think If single_db_connection then func_odbc should keep and lock the connection to avoid other threads to use this connection.
Now it only keeps without locking.
The single_db_connection was added because MySQL's LAST_INSERTED_ID() works per-connection and returns 
"value representing the first automatically generated value successfully inserted for an AUTO_INCREMENT column as a result of the MOST RECENTLY executed INSERT statement".
If another thread executes INSERT statement into the table with the AUTO_INCREMENT column on the same connection then the result of LAST_INSERTED_ID() will be incorrect.


> func_odbc: Database handle is kept when it should be released
> -------------------------------------------------------------
>
>                 Key: ASTERISK-26177
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26177
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Functions/func_odbc
>    Affects Versions: 13.10.0-rc1
>         Environment: CentOS 6.8 64 bit with unixODBC-2.3.4-1 backported from fc23 and Oracle Mysql connector 5.3.6
>            Reporter: Leandro Dardini
>         Attachments: backtrace-threads.txt, coreshowlocks.txt, full-lock.txt
>
>
> When processing normal dialplan commands, including several ODBC commands, at some point, just running a simple command like "FollowMe" locks up asterisk. Running the FollowMe command with the same parameter, but without running anything before, produces no lock. The same dialplan run under asterisk 13.2.0 produces no issues.



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



More information about the asterisk-bugs mailing list