Hi Peter,

I originally implemented the re-connect code.  All you have to do is
understand how to get errors back from the library/api that goes along
with the c api of your interface to your favorite database module.

I implemented it in such a way that if you return SQL_DOWN when the
database appears to be 'down' and 'need to re-connect this socket'.
The database independent code handles this properly to re-connect in
down situations such that one try is made, and if the try fails, the
timeout then applies for re-trying to connect this particular socket.
Obivously if the re-connect fails, the query to the database fails as
well.

You should also look at the 'src/modules/rlm_sql/README' file in which
I've placed a few comments as to what the database driver api should do.
Start with: Returning 'SQL_DOWN'....

In any event, if you can nab some documentation for the database
specific library, finding the error codes when a connection fails, and
mapping the ones that mean 'the database is down' to a return value of
'SQL_DOWN' is pretty much what you need to do.

If I'm unclear, feel free to contact me, I'm interested in assisting
anyone to get the rest of the database drivers to do reconnect properly,
though I do not have the time (in the forseeable future) to implement it
myself.

On Fri, 2002-11-08 at 10:24, Peter Nixon wrote:
> On Fri, 08 Nov 2002 09:45:02 -0600
> Squire Chris Parker uttered the following:
> 
> > At 04:17 PM 11/8/2002 +0200, Peter Nixon wrote:
> > >What is the situation regarding reconnects in the rlm_sql module
> > >(specifically with the postgres driver)?
> > >I read the following thread:
> > >http://lists.cistron.nl/pipermail/freeradius-devel/2002-July/002921.html
> > >
> > >But did reconnect code ever make it into FreeRadius? It certainly
> > >doesn't seem to be working for me.
> > 
> > It requires modifications to the sql drivers to fully support. 
> > Currently, this is only done for MySQL AFAIK.  The main 'rlm_sql'
> > supports it if the drivers are suitably updated.
> > 
> > To repeat Alan's mantra:  Patches are welcome!
> 
> Ok. Thanks. I will check out the mysql module then and see how difficult it
> is to port the logic to postgres. My C skills are only moderate so we shall
> see :-)
> 
> -- 
> 
> Peter Nixon
> http://www.peternixon.net/
> PGP Key: http://www.peternixon.net/public.asc
-- 
Todd T. Fries <[EMAIL PROTECTED]>


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to