[EXIM] Hanging incoming connections - suggested fix

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: Nigel Metheringham
CC: Exim Users List
Tárgy: [EXIM] Hanging incoming connections - suggested fix
On Wed, 14 Oct 1998, Nigel Metheringham wrote:

> We have seen incoming SMTP connections hanging - for days if they are left
> - when the originating system goes away. This is normally seen on dial-up
> IPs. Of course its very hard to reproduce when you need to, but it has
> been causing us problems with lots of incoming slots being taken up.


This is a timely patch for us. I just killed off 14 such processes left
over from a day or two ago when our network was down. I've been trying
to nail this one down for quite some time - the process is always stuck
inside read(), and seems to have lost the timeout, or the ALRM signal
failed to interrupt the read(). This is on Solaris 2.5 - did you see it
on a non-Solaris system?

> To fix this we have made a small modification to exim which adds keepalive
> to the incoming SMTP socket connections. For symmetry we also do this on
> outgoing SMTP. This means that if there is no traffic on the socket, the
> kernel should periodically send some OOB data - a keepalive - across the
> connection. If this fails the read is terminated (there may be a set of
> TCP timeouts involved as well).


How did you discover that this was the way to solve the problem? Thanks
for the research!

> I believe that the setsockopt with keepalive should be pretty portable.


We shall see, he said, ruefully, having spent yesterday discovering the
subtle differences (read "nasty gotchas") between "make" on IRIX 6.5 and
"make" on Solaris 2.5.

> I am not sure that the enclosed patch is the best way of applying the
> keepalive - there may be a better location for it in the source. The
> keepalive is a socket level option so should just work for IPv6 (Decnet or
> whatever) transports as well.


OK. Will apply my usual eagle-eyed scrutiny when I get to look at it in
detail.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.



--
*** Exim information can be found at http://www.exim.org/ ***