From: steffen@manta.latrade.com (Steffen Ullrich)
Subject: Re: socket still listening after process crashes
Date: 1996/06/27 [thread overview]
Message-ID: <835883624.30262@manta.latrade.com> (raw)
In-Reply-To: 4qpeul$pn3@xensei3.xensei.com
In article <4qs7r3$2ol@pt9201.ped.pto.ford.com>,
millerb@pt9536.ped.pto.ford.com (Bryan Miller) writes:
> ccrlphr@xensei.com appears to have written:
>
>>we realized the following weird behavior on DEC UNIX 3.2C:
>>1. an application creates a socket, binds it and put it into LISTEN mode.
>>2. the application accepts various connection
>>3. the application crashes (for instance using kill -BUS ..). after the
>> application dumped the core:
>
> [ snippy snip]
>
>> - is there a patch available and/or is this problem solved in DEC UNIX 4.0?
>> - is there a workaround? (SO_REUSEADDR does not help, SO_KEEPALIVE
>> checks only every 2..3 hours which is not fast enough)
>
> We are having the same problem running perl 5.001 under Digital
> Unix 3.2D-1. It usually takes 40 minutes for the connection
> to time out. Nasty when inetd or some daemon is trying to
> re-use the port. Any tips or patch numbers would be great.
>
with some help from Christoph Robitschko <chmr@freebee.tu-graz.ac.at> we
realized that the problem was caused by the fact that child processes
of the server were still alive. to get rid of this problem you should
either close the sockets you don't need (e.g. the listener) by hand after forking
or - if you make an exec after the fork (like we did) simple
fcntl(socket,F_SETFD,FD_CLOEXEC)
this will ensure that the new process will close this socket while doing "exec".
works great for us.
prev parent reply other threads:[~1996-06-27 4:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-25 4:00 socket still listening after process crashes ccrlphr
1996-06-27 4:00 ` Steffen Ullrich [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox