Skip to content

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

@grs01

Description

@grs01

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'} = [];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions