How to reuse TCP listening socket immediately after it was connected at least once?

Thomas Bellman bellman at lysator.liu.se
Sat May 30 01:44:57 EDT 2009


Lawrence D'Oliveiro <ldo at geek-central.gen.new_zealand> wrote:

> In message <gvlppt$hk0$1 at news.lysator.liu.se>, Thomas Bellman wrote:

>> Speaking as a sysadmin, running applications for production,
>> programs not using SO_REUSEADDR should be taken out and shot.

>> Not using SO_REUSEADDR means forcing a service interruption of
>> half an hour (IIRC) if for some reason the service must be
>> restarted, or having to reboot the entire machine.

> No, you do not recall correctly.

*Tests*  It seems to be 100 seconds in Fedora 9 and 60 seconds in
Solaris 10.  OK, that amount of time is not totally horrible, in
many cases just annoying.  Still much longer for an interruption
of service that could have been just 1-2 seconds.

However, I *have* used systems where it took much longer.  It was
slightly more than ten years ago, under an earlier version of
Solaris 2, problably 2.4.  It may be that it only took that long
under certain circumstances that the application we used always
triggered, but we did have to wait several tens of minutes.  It
was way faster to reboot the machine than waiting for the sockets
to time out.

> And anybody wanting to reboot a machine to
> work around a "problem" like that should be taken out and shot.

We weren't exactly keen on rebooting the machine, but it was the
fastest way of getting out of that situation that we could figure
out.  How *should* we have dealt with it in your opinion?


-- 
Thomas Bellman,   Lysator Computer Club,   Linköping University,  Sweden
"God is real, but Jesus is an integer."      !  bellman @ lysator.liu.se
                                             !  Make Love -- Nicht Wahr!



More information about the Python-list mailing list