On Thursday 06 January 2011 01:45:00 Victor Duchovni wrote:
> On Wed, Jan 05, 2011 at 06:56:31PM -0500, Wietse Venema wrote:
> > Each verify or postscreen or tlsmgr process will at set times
> > scan the database for old entries.
> > 
> > If it so happens that this scan doesn't finish before the new one
> > starts, then it would really be a W*T*F* moment if the code decides
> > that the new scan completes immediately, especially if it means
> > that the old scan is stopped too.
> 
> When the Postfix queue-manager is scanning the incoming or deferred queue,
> if another scan request comes in in the middle of an existing scan, the
> exsting scan continues, but a flag is set (idempotent) that indicates
> that a new scan should start as soon as the old scan completes.
> 
> In this case, it is not as critical to set such a flag, but it is important
> to allow the existing scan to continue to completion, and ignore or
> (just note) new requests until it does. Once a scan completes, new
> scans can proceed either immediately (saved flag) or when next requested.

That's what I have implemented. If a cleanup process is already running and a 
second cleanup process starts then the second process will quit as if the 
database was empty and it will log a warning that the cleanup was skipped due 
to an already running process. The first cleanup process will continue and 
complete the database scan. A subsequent cleanup process will start as 
scheduled.
I don't use a flag to put a simultaneously running cleanup process on hold, it 
will just be skipped. And that shouldn't be a problem because the cleanup 
process isn't a time critical process.

I'm sorry for the confusion.

regards
Stefan

Reply via email to