[Home]

Summary:ASTERISK-16748: [patch] res_config_pgsql needs db reconnection support
Reporter:Mark Murawski (kobaz)Labels:
Date Opened:2010-09-28 15:32:01Date Closed:2011-01-07 01:47:39.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_config_pgsql
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) res_config_pgsql.patch
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.
Comments:By: Mark Murawski (kobaz) 2010-09-28 15:45:26

reviewboard link: https://reviewboard.asterisk.org/r/944/

By: Digium Subversion (svnbot) 2011-01-07 01:47:38.000-0600

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 ASTERISK-16748)

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

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