[Home]

Summary:ASTERISK-11214: All ODBC calls do not timeout
Reporter:Norman Franke (norman)Labels:
Date Opened:2008-01-11 14:39:40.000-0600Date Closed:2008-01-11 18:15:49.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_odbc
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk-1.4.15.diff
Description:In testing what happens when my DB fails (easily simulated using iptables), I noticed that Asterisk either takes 3 minutes to timeout a connect or never times out SQLPrepare. All of these are due to missing calls to both SQLSetConnectAttr and SQLSetStmtAttr. This affects res/res_odbc.c, res/res_config_odbc.c and cdr/cdr_odbc.c

I've enclosed a patch that works properly. Note when using FreeTDS as an ODBC connector, you need to use 0.82 since earlier versions did not implement timeout even slightly correct.
Comments:By: Digium Subversion (svnbot) 2008-01-11 18:03:26.000-0600

Repository: asterisk
Revision: 98467

U   branches/1.4/res/res_odbc.c

------------------------------------------------------------------------
r98467 | tilghman | 2008-01-11 18:03:25 -0600 (Fri, 11 Jan 2008) | 4 lines

Add a connection timeout attribute, as that was what was intended with the
login timeout, but ODBC divides it up into 2 different timeouts.
(Closes issue ASTERISK-11214)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=98467

By: Digium Subversion (svnbot) 2008-01-11 18:15:49.000-0600

Repository: asterisk
Revision: 98487

_U  trunk/
U   trunk/res/res_odbc.c

------------------------------------------------------------------------
r98487 | tilghman | 2008-01-11 18:15:48 -0600 (Fri, 11 Jan 2008) | 12 lines

Merged revisions 98467 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98467 | tilghman | 2008-01-11 18:05:08 -0600 (Fri, 11 Jan 2008) | 4 lines

Add a connection timeout attribute, as that was what was intended with the
login timeout, but ODBC divides it up into 2 different timeouts.
(Closes issue ASTERISK-11214)

........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=98487