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

larsen

Active Member
Feb 28, 2020
155
17
38
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

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!