From dev-return-14819-apmail-directory-dev-archive=directory.apache.org@directory.apache.org Thu Dec 28 13:55:42 2006 Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 90702 invoked from network); 28 Dec 2006 13:55:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Dec 2006 13:55:40 -0000 Received: (qmail 35372 invoked by uid 500); 28 Dec 2006 13:55:46 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 35342 invoked by uid 500); 28 Dec 2006 13:55:46 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 35331 invoked by uid 99); 28 Dec 2006 13:55:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Dec 2006 05:55:46 -0800 X-ASF-Spam-Status: No, hits=0.3 required=10.0 tests=MAILTO_TO_SPAM_ADDR,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of akarasulu@gmail.com designates 64.233.184.237 as permitted sender) Received: from [64.233.184.237] (HELO wr-out-0506.google.com) (64.233.184.237) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Dec 2006 05:55:35 -0800 Received: by wr-out-0506.google.com with SMTP id 58so478200wri for ; Thu, 28 Dec 2006 05:55:15 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:sender; b=UHGeMUw4R4zK0lwvmaGiAK4nM9i98cJ8NT9z0AcO04Qy2HSu87hkyHNtOf2IB7c9AWkDabv2uYFyps3oLBsszKUIm7xXLNWfdw9eMOIydURpcYNqyZFlEzgOjHkSjGnCzVioXNSOiVPFfIbSBxuFVkmgViqdcIM6CTaZYItRNck= Received: by 10.90.52.2 with SMTP id z2mr11851315agz.1167314115097; Thu, 28 Dec 2006 05:55:15 -0800 (PST) Received: from ?192.168.248.12? ( [12.104.1.131]) by mx.google.com with ESMTP id 20sm21977518agb.2006.12.28.05.55.14; Thu, 28 Dec 2006 05:55:14 -0800 (PST) Message-ID: <4593CCBD.5030002@apache.org> Date: Thu, 28 Dec 2006 08:55:09 -0500 From: Alex Karasulu Reply-To: akarasulu@apache.org Organization: Apache Software Foundation User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: TCP service not shutting down cleanly References: <800df6390612260949s4b6ffbbakbd76f46325d973bf@mail.gmail.com> <800df6390612270604i70806c72s55bdf2d74353610f@mail.gmail.com> In-Reply-To: <800df6390612270604i70806c72s55bdf2d74353610f@mail.gmail.com> Content-Type: multipart/mixed; boundary="------------050409050602050609070505" Sender: Alex Karasulu X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. --------------050409050602050609070505 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Marc Boorshtein wrote: >> Well, this is a rampant problem we have, and it don't want to vanish... > > Odd, why didn't this happen in the original version I used? > >> If you are on linux, you can modify you TCP keepalive parameter to a >> smaller >> value, so the socket will be freed faster. >> > > This didn't work. How does the ApacheDS team handle this issue in > it's automated tests? > >> The problem might be that you violently stop the server, and some sockets >> are still pending, waiting for a timeout. If you gently stop the server, >> then I *think* mina closes all the opened socket nicely, and left the >> socket >> available immediatly. To be verified... >> > > Was the code I was using to stop my server incorrect? > Hmmm I did not have a chance to look thoroughly at the code. However there is a paramter for MINA that we do use that may help you. Look here ... // Disable the disconnection of the clients on unbind SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig(); acceptorCfg.setDisconnectOnUnbind( false ); acceptorCfg.setReuseAddress( true ); acceptorCfg.setFilterChainBuilder( chainBuilder ); acceptorCfg.setThreadModel( threadModel ); ((SocketSessionConfig)(acceptorCfg.getSessionConfig())).setTcpNoDelay( true ); tcpAcceptor.bind( new InetSocketAddress( port ), protocolProvider.getHandler(), acceptorCfg ); Make sure you're using the following parameters to the acceptor config. Namely the reuse address true parameter. HTH, Alex --------------050409050602050609070505 Content-Type: text/x-vcard; charset=utf-8; name="akarasulu.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="akarasulu.vcf" begin:vcard fn:Alex Karasulu n:Karasulu;Alex org:Apache Software Foundation;Apache Directory adr:;;1005 N. Marsh Wind Way;Ponte Vedra ;FL;32082;USA email;internet:akarasulu@apache.org title:Member, V.P. tel;work:(904) 791-2766 tel;fax:(904) 808-4789 tel;home:(904) 808-4789 tel;cell:(904) 315-4901 note;quoted-printable:AIM: alexokarasulu=0D=0A= MSN: aok123@bellsouth.net=0D=0A= Yahoo!: alexkarasulu=0D=0A= IRC: aok=0D=0A= PGP ID: 1024D/4E1370F8 BBCC E8D8 8756 2D51 C3D4 014A 3662 F96F 4E13 70F8=0D=0A= x-mozilla-html:FALSE url:http://people.apache.org/~akarasulu version:2.1 end:vcard --------------050409050602050609070505--