Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Over time the number of processes 'processing' increases #124

Open
grs01 opened this issue Dec 8, 2021 · 0 comments
Open

Over time the number of processes 'processing' increases #124

grs01 opened this issue Dec 8, 2021 · 0 comments

Comments

@grs01
Copy link

grs01 commented Dec 8, 2021

Over time i'm steadily seeing the number of processes 'processing' increasing.

It appears that the client (Postfix) connecting to the authentication milter is terminating it's side of the connection. But, on the Authentication Milter server the connection remains in the established state and never times out.

e.g.

ps: 
authmil+  327438   30036  0 Nov24 ?        00:00:01 authentication_milter_am1:processing:postenvrcpt(41)

netstat:
tcp        0      0 n.n.n.n:8892          n.n.n.n:50568         ESTABLISHED 327438/authenticati

Is there an overall timeout that can be applied to resolve this situation?

As a workaround i've patched my local Authentication.pm and reduced net.ipv4.tcp_keepalive_time to 300s, which appears to resolve the issue. But, a server side timeout would probably be a better solution.

@@ -16,6 +16,7 @@
 use Log::Dispatchouli;
 use Net::DNS::Resolver;
 use Net::IP;
+use IO::Socket;
 use Proc::ProcessTable;
 use base 'Mail::Milter::Authentication::Net::ServerPatches';
 use vars qw(@ISA);
@@ -383,6 +384,7 @@
     $PROGRAM_NAME = $Mail::Milter::Authentication::Config::IDENT . ':processing(' . $count . ')';
     $self->logdebug( 'Processing request ' . $self->{'count'} );
     $self->{'socket'} = $self->{'server'}->{'client'};
+    $self->{'socket'}->setsockopt(SOL_SOCKET, SO_KEEPALIVE, 1);

     $self->{'tracelog'} = [];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant