Re: filedescriptor leak on 1.2b20

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Sat, 16 May 1998 16:06:01 +0200

Apiset Tananchai wrote:

> My problem is that squid start using a large number of file
> descriptors when user trying to goto ip addresses that have no
> route to. Here's some part of file descriptor report from
> cache_object://.../filedescriptors 203.155.33.12 is our proxy
> server and 203.155.32.150 is the host that has to route to it.

This probably caused by a known issue in 1.2beta. The caused is client
half-side close support, and the workaround is to disable TCP half-side
close support. [patch attached]

Squid can't detect if is only half-closed request or aborted, and
because of this it has to assume that it is half-closed. This is
normally not a problem as the requests times-out after the connect
timeout interval, but when a popular server goes dead it may become a
big problem.

If this is the cause, then you should see a fair amount of
filedescriptors marked as "half-closed" as well. If not please send a
message to squid-bugs@nlanr.net.

---
Henrik Nordström
Sparetime Squid Hacker

--- squid-1.2.beta20-1/src/client_side.c.orig Sat Apr 25 14:46:11 1998
+++ squid-1.2.beta20-1/src/client_side.c Sat May 16 15:46:37 1998
@@ -1913,10 +1913,13 @@
      */
     commSetSelect(fd, COMM_SELECT_READ, clientReadRequest, conn, 0);
     if (size == 0) {
+#if CLIENT_HALF_SIDE_CLOSE
         if (conn->chr == NULL) {
+#endif
             /* no current or pending requests */
             comm_close(fd);
             return;
+#if CLIENT_HALF_SIDE_CLOSE
         }
         /* It might be half-closed, we can't tell */
         debug(33, 5) ("clientReadRequest: FD %d closed?\n", fd);
@@ -1925,6 +1928,7 @@
         conn->defer.n++;
         fd_note(fd, "half-closed");
         return;
+#endif
     } else if (size < 0) {
         if (!ignoreErrno(errno)) {
             debug(50, 2) ("clientReadRequest: FD %d: %s\n", fd, xstrerror());
Received on Sat May 16 1998 - 07:34:44 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:40:12 MST