From owner-freebsd-hackers Tue Apr 1 17:39:55 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id RAA23108 for hackers-outgoing; Tue, 1 Apr 1997 17:39:55 -0800 (PST) Received: from scanner.worldgate.com (scanner.worldgate.com [198.161.84.3]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id RAA23103; Tue, 1 Apr 1997 17:39:53 -0800 (PST) Received: from znep.com (uucp@localhost) by scanner.worldgate.com (8.8.5/8.7.3) with UUCP id SAA23555; Tue, 1 Apr 1997 18:39:50 -0700 (MST) Received: from localhost (marcs@localhost) by alive.znep.com (8.7.5/8.7.3) with SMTP id SAA09355; Tue, 1 Apr 1997 18:39:30 -0700 (MST) Date: Tue, 1 Apr 1997 18:39:30 -0700 (MST) From: Marc Slemko To: Renaud Waldura cc: freebsd-isp@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: Apache lingering_close error In-Reply-To: <199704012328.PAA15669@softway95.softway.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Tue, 1 Apr 1997, Renaud Waldura wrote: > > I'm using Apache 1.2b7. With the proxy module, I got lots of errors: > > [Fri Mar 28 22:42:11 1997] shutdown: Invalid argument > [Fri Mar 28 22:42:11 1997] - lingering_close > > until I added > > EXTRA_CFLAGS=-DUSE_SO_LINGER -DNO_LINGCLOSE > > in the Configuration file. > > It works fine now, although the documentation > http://www.apache.org/docs/misc/fin_wait_2.html > makes me wonder if this was the Right Thing To Do. > > It says that FreeBSD 2.1 implements correctly the FIN_WAIT_2 timeout, > but does this mean that SO_LINGER is ok too? There is no reason to disable linging_close for FreeBSD[1]. The message is simply a combination between a warning and a not-yet-removed debugging message; most of the time it pops up simply due to a race condition in the code path; there are a couple of additional issues when using it with the proxy code that I haven't had time to follow, but nothing that hurts more than outputting that message sometimes. It should not hurt anything. We are having some trouble with the lingering_close function (which is why I wrote the above web page...) and are still playing around with a few things. I don't really want to comment on the SO_LINGER part other than to say that you should just use lingering_close in FreeBSD. [1] That is a lie. There are some performance issues that come up when using lingering_close (ie. child processes potentially hang around finishing up a request for longer), but SO_LINGER potentially has even more performance problems. What we really need is a better API, but lacking that lingering_close is the best solution[2]. It _IS_ necessary. [2] For now. This whole issue will go away in 2.0 because then the only overhead will be keeping the socket over, since 2.0 will threaded so the cleanup doesn't have to block a whole process.