Amavis stops working after finishing max_requests
See original GitHub issueImpacted versions
- OS Type: Debian
- OS Version: 11
- Database Type: PostgreSQL
- Database version: 13.4
- Modoboa: 1.17.0
- installer used: No
- Webserver: Nginx
Steps to reproduce
- Have postfix+amavis setup running as intended by the installer
- Have
$max_servers = 1;
in/etc/amavis/conf.d/50-user
- See amavis closing the process after processing 20 requests (default setting)
- Notice amavis stopping
Current behavior
With the setup as configured by modoboa-installer
amavis will run with a single master process. Amavis will kill its process after a configured number of processed messages (this number is 20 by default), after which Net::Server
should start a new process.
After I upgraded to Debian 11 this behaviour seems broken - the limit is reached, the current process is terminated, but no new process is spawned:
Oct 11 12:51:39 mailserver amavisd-new[4150261]: Oct 11 12:51:39.429 mailserver /usr/sbin/amavisd-new[4150261]: (4150261-20) Requesting process rundown after 20 tasks (and 20 sessions)
Once amavis has cleaned up after receiving SIGTERM
the whole unit comes to a stop:
Oct 11 12:51:40 mailserver systemd[1]: amavis.service: Succeeded.
Oct 11 12:51:40 mailserver systemd[1]: amavis.service: Consumed 14.497s CPU time.
As amavis is correctly configured as a proxy_filter in postfix, this results in all incoming mails bouncing.
Expected behavior
The Amavis unit stays alive after planned process rundown.
Possible fix
I still have to run some tests, but I increased the $max_proesses
to any number bigger than 1
which results in amavis spawning actual child processes which can then be terminated and restarted without issue (I checked this by limiting $max_requests
to 1
forcing amavis to restart a child after processing a single mail).
Theoretically smtpd
processes will wait for amavis processes to become available, allowing mail clients to terminate a submission if it takes too long (as the smtpd
process waits for amavis to finish) so increasing max_servers
should be fine.
But I haven’t been able to figure out why amavis doesn’t spawn a single child process (which it can then restart) and instead uses the master process which (in essence) terminates itself after 20 tasks have been completed.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
@PatTheMav Thanks for sharing your debug work, you saved me a lot of time!
TBF, if you don’t use the installer and compose your own custom modoboa setup, you’re kinda on your own in figuring out all the bits and pieces work as intended. Took me ages to actually go and check the systemd unit file - but always good to have learnt something. 😄