Re: race condition?

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Lee McLoughlin
Fecha:  
A: Neal Becker
Cc: exim-users
Asunto: Re: race condition?
Neal Becker wrote:
>
> I noticed this happened twice:
>
> --- mainlog ---
> 1996-04-09 16:42:44 pid 242: SIGHUP received: re-exec daemon
> ---------------
> --- paniclog ---
> 1996-04-09 16:42:44 socket bind() to port 25 failed: Address already in use
> ---------------
>
> This was on hpux9.05. Is it possible that a delay is needed? Did the
> old process forget to close the socket before re-exec?
>
> Note: I have sighup'd exim on other machines without this problem, so
> either it is a function of the machine or the load or is just
> intermittent.


Serveral unixes hang onto bound sockets after the process that owns them has vanished.
Solaris 2.4 was particularly bad, Solaris 2.5 seems to have fixed it, but both Solaris
and Sunos kernels certainly did this. Sometimes delaying for 60 seconds would give
things time to clear.

I think it might be best to put a loop around the bind to allow it to try a few times,
with a minutes delay between each try, before giving up.

--
Lee McLoughlin.                         Phone: +44 171 594 8388
IC-Parc, Imperial College,              Fax:   +44 171 594 8449
South Kensington, London. SW7 2BZ. UK.  Email: L.McLoughlin@???