[Mimedefang] Playing with -X and -P for Ticks

David F. Skoll dfs at roaringpenguin.com
Mon Oct 22 19:26:34 EDT 2012


On Mon, 22 Oct 2012 17:33:17 -0400
"Kevin A. McGrail" <KMcGrail at pccc.com> 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.



More information about the MIMEDefang mailing list