On Mon, 22 Oct 2012 17:33:17 -0400
"Kevin A. McGrail" <[email protected]> wrote:

> Thanks David.  In a way, this was more helpful than you might imagine 
> because my analysis was leading towards certain slaves never running 
> ticks but this makes it definitive without me researching.

You're welcome.

> For me, at least, with a 0.33% failure rate being rather low, rather 
> than adding ping a whole bunch of times at each callback that might
> use a DB call, I've changed my centralized query function to try
> connecting if the query fails with what looks like a timeout
> failure.  I also added some logic so it tries only one more time.

You could do it that way, sure.  Here's how we do it in CanIt: At the
entry point to any function that could conceivably be a "wakeup point"
for a slave, we make sure the DB connection is OK (and reconnect if it
isn't.)  This happens near the beginning of the MIMEDefang callbacks
filter_relay, filter_helo, filter_sender, filter_recipient and
filter_begin, though CanIt actually only uses filter_recipient and
filter_begin.

The rest of the code simply assumes that the DB handle is OK.  If it isn't,
we throw an exception and tempfail the mail.  We only do the ping test
once per callback when the slave might have been dormant for a while.

Regards,

David.
_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to