[asterisk-bugs] [Asterisk 0018071]: [patch] res_config_pgsql needs db reconnection support

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jan 7 07:47:38 UTC 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18071 
====================================================================== 
Reported By:                kobaz
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18071
Category:                   Resources/res_config_pgsql
Reproducibility:            have not tried
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
JIRA:                       SWP-2313 
Regression:                 No 
Reviewboard Link:           https://reviewboard.asterisk.org/r/944/ 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!): 289174 
Request Review:              
====================================================================== 
Date Submitted:             2010-09-28 15:32 CDT
Last Modified:              2011-01-07 01:47 CST
====================================================================== 
Summary:                    [patch] res_config_pgsql needs db reconnection
support
Description: 
If your postgres connection died suddenly in between res_config_pgsql
queries, the query will fail because the query is executed on a
disconnected/disconnecting handle.

Reviewboard patch adds support for reconnecting and retrying the failed
query if the connection was closed while executing the query.  The patch
also removes lots of checking and duplication for handling query errors.

Ideally there should be a centralized res module for postgres connections
that cdr_pgsql and res_config_pgsql (and any other pgsql dependent module)
can use for a centralized db abstraction module.

But I believe fixing up res_config_pgsql is the first step.
====================================================================== 

---------------------------------------------------------------------- 
 (0130291) svnbot (reporter) - 2011-01-07 01:47
 https://issues.asterisk.org/view.php?id=18071#c130291 
---------------------------------------------------------------------- 
Repository: asterisk
Revision: 300882

U   trunk/res/res_config_pgsql.c

------------------------------------------------------------------------
r300882 | markm | 2011-01-07 01:47:37 -0600 (Fri, 07 Jan 2011) | 12 lines

Added support for postgres database retry query on disconnection to
res_config_pgsql

If your postgres connection died suddenly in between res_config_pgsql
queries, the next query will fail because the query is executed on a
disconnected/disconnecting handle.  The query is abandoned and is
returned from in error.

Now we will reconnect and try again if a query was run on a
disconnected connection.

(closes issue https://issues.asterisk.org/view.php?id=18071)

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

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

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-01-07 01:47 svnbot         Checkin                                      
2011-01-07 01:47 svnbot         Note Added: 0130291                          
======================================================================




More information about the asterisk-bugs mailing list