From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 25 03:22:59 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 132A537B401 for ; Wed, 25 Jun 2003 03:22:59 -0700 (PDT) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF8DF43FA3 for ; Wed, 25 Jun 2003 03:22:57 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from user-38lc0fm.dialup.mindspring.com ([209.86.1.246] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 19V7QU-0006Rl-00; Wed, 25 Jun 2003 03:22:54 -0700 Message-ID: <3EF97797.8179C019@mindspring.com> Date: Wed, 25 Jun 2003 03:21:11 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Varshavchick Alexander References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a4312f554fbf463f4b4735978ca18ebc203ca473d225a0f487350badd9bab72f9c350badd9bab72f9c cc: freebsd-hackers@FreeBSD.ORG Subject: Re: How to delete unix socket entries X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2003 10:22:59 -0000 Varshavchick Alexander wrote: > Terry, you're right that all this happened because of the server > application core dumped while in the process of sending/receiving data, > and that application is fixed so there are no new zombi sockets, but what > can I do now with the ones which already exist? How can I delete them now? If it's fixed: reboot. If it's not fixed, add this to your /etc/rc.local: sysctl net.inet.tcp.always_keepalive=0 ...and reboot. Nothing short of rebooting is going to undo the deadlock, unless you have the kernel debugger compiled into your kernel, and are willing to grovel around in data structures to find the root cause of your problem. There is no such thing as a "zombie socket", there are only sockets which are in TIME_WAIT, FIN_WAIT, FIN_WAIT_2, etc., states. These tend to persist for 2MSL (about 5 minutes) after the process has exited. That you are having this problem is indicative of the other end of the socket connection still being alive somewhere, and/or a real bug that was triggered by the default being to set "keepalive" on the sockets, even though they are UNIX domain sockets. You could probably fix this by overriding the "keepalive" setting on the created sockets in the kernel function "socketpair". Without a reproducible test case, I can't provide you a kernel patch to fix the problem for you in the future. My advice is to turn off the keepalive; I expect it will help. -- Terry