[SOLVED] Querying verify_cache with postmap often waits minutes for a read lock

larsen

Well-Known Member
Feb 28, 2020
168
20
58
When I run
Code:
postmap -q jondoe@example.com btree:/var/lib/postfix/verify_cache
this often takes up to 15 minutes or more until I get a result. The next second, it returns instantly.

I checked this with strace and noticed that it's waiting for a read lock for the "verify_cache.db". "/usr/lib/postfix/sbin/verify" is the process that is holding a write lock when the delay happens. From "man 8 verify":
Code:
as verify(8) processes are long-lived

When my postmap command returns, the verify process that existed before, has gone. A new verify process will be started shortly after.
I checked the maillog as this happened, but couldn't see anything that would cause this.

Is this expected behaviour?


Lars
 
Is this expected behaviour?
Without explicitly reading through the source code - I do guess so - the database needs to be held exclusively open by the process filling the verify cache (verify(8)) and querying it

I usually recommend to copy the verify database somewhere else before quering it with postmap - as far as I remember the file is quite small and can be copied fine while postfix is running

Out of curiosity - how often do you need to do manual lookups in the verification cache and why?

I hope this helps!
 
Thanks for the info!
I don't need it that often. We just recently started using PMG, so there will probably be less and less need for such things.
 
  • Like
Reactions: Stoiko Ivanov