Stefan Jakobs:
> On Tuesday, 14th of December 2010, 20:09:26 Wietse Venema wrote:
> <snip>
> > > Yes, I have tested that and it worked without problems. If you
> > > are interested then I will send you the logs of that test.
> > 
> > Yes, it would help when I want to run some tests (the results should
> > be similar).
> 
> I send you the logs in a separate message.
> 
> > One more question: what happens if a "first" sequence operation is
> > requested before the last one is finished? Should the code maintain
> > an internal flag that the "handler open" is still in effect, and
> > do the "right" thing when another "first" sequence operation is
> > requested?
> 
> The call of a "first" sequence operation will reset the cleanup process, so 
> the last elements will never be seen by the cleanup process.
> I introduced a semaphore to circumvent that. If a second sequence operation 
> starts before the first one has finished, it will quit and return as if the 
> database was empty.
> You will find the new patch in the appendix.
> 
> I tried to produce a situation where two cleanup processes were running 
> simultaneously, but I couldn't. Even with a 
> address_verify_cache_cleanup_interval of 2s and a database with more than 
> 100.000 entries (the cleanup took 82s) only one cleanup process was running. 
> Another one started 2 seconds after the first one finished.
> 
> # egrep "dict_cache_clean_event: (done|start)" /var/log/mail
> Jan  5 15:04:34 mx2 postfix/verify[30223]: dict_cache_clean_event: start 
> /etc/mx/verify.cf cache cleanup
> Jan  5 15:05:56 mx2 postfix/verify[30223]: dict_cache_clean_event: done 
> /etc/mx/verify.cf cache cleanup scan
> Jan  5 15:05:58 mx2 postfix/verify[30223]: dict_cache_clean_event: start 
> /etc/mx/verify.cf cache cleanup
> 
> I'm not sure if it is possible that two cleanup processes can run 
> simultaneously. Wietse, how are the cleanup processes scheduled and executed? 
> From the above it looks as if the next cleanup process will not be scheduled 
> until the current one has finished. Is that the case?
> 
> Thanks for your patience and help.

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.

        Wietse

Reply via email to