Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 74065 invoked from network); 7 May 2007 04:50:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 May 2007 04:50:40 -0000 Received: (qmail 16632 invoked by uid 500); 7 May 2007 04:50:46 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 16597 invoked by uid 500); 7 May 2007 04:50: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 16572 invoked by uid 99); 7 May 2007 04:50:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 06 May 2007 21:50:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [72.51.41.97] (HELO ns2.scheduleworld.com) (72.51.41.97) by apache.org (qpsmtpd/0.29) with SMTP; Sun, 06 May 2007 21:50:38 -0700 Received: from 10.0.2.93 ([10.0.2.93]) by ns2.scheduleworld.com (JAMES SMTP Server 2.2.1-RC1) with SMTP ID 874 for ; Mon, 7 May 2007 00:50:04 -0400 (EDT) Message-ID: <463EAFD5.5000707@ScheduleWorld.com> Date: Mon, 07 May 2007 00:49:25 -0400 From: Mark Swanson User-Agent: Thunderbird 1.5.0.10 (X11/20070221) MIME-Version: 1.0 To: Apache Directory Developers List Subject: Re: Bug/Feature request: SO_REUSEADDR References: <463D6A66.5000202@ScheduleWorld.com> <463DA155.60300@apache.org> In-Reply-To: <463DA155.60300@apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Emmanuel Lecharny wrote: > Mark Swanson a écrit : > >> Hello, > > Hi Mark ! > >> >> Please use SO_REUSEADDR when binding to TCP ports. >> In production, when an ADS server is restarted it fails to start until >> all of the sockets that used to be connected exceed their FIN_WAIT1 >> timeout. > > This is already done : > > ... > try > { > // Disable the disconnection of the clients on unbind > SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig(); > acceptorCfg.setDisconnectOnUnbind( false ); > acceptorCfg.setReuseAddress( true ); > ... > > either in 1.0 or in 1.5. > > There must be something different. Well, just to be sure the line numbers match up so we're talking about the same code here is the Exception: [00:38:48] ERROR [org.apache.directory.daemon.Bootstrapper] - Failed on org.apache.directory.server.Service.init(InstallationLayout, String[]) org.apache.directory.shared.ldap.exception.LdapConfigurationException: Failed to bind an LDAPservice (389) to the service registry. [Root exception is java.net.BindException: Address already in use] at org.apache.directory.server.jndi.ServerContextFactory.startLDAP0(ServerContextFactory.java:487) at org.apache.directory.server.jndi.ServerContextFactory.startLDAP(ServerContextFactory.java:401) at org.apache.directory.server.jndi.ServerContextFactory.afterStartup(ServerContextFactory.java:211) at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:239) at org.apache.directory.server.core.jndi.AbstractContextFactory.getInitialContext(AbstractContextFactory.java:118) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288) at javax.naming.InitialContext.init(InitialContext.java:223) at javax.naming.InitialContext.(InitialContext.java:197) at javax.naming.directory.InitialDirContext.(InitialDirContext.java:82) at org.apache.directory.server.Service.init(Service.java:96) at org.apache.directory.daemon.Bootstrapper.callInit(Bootstrapper.java:151) at org.apache.directory.daemon.JsvcBootstrapper.init(JsvcBootstrapper.java:56) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.commons.daemon.support.DaemonLoader.load(DaemonLoader.java:160) Caused by: java.net.BindException: Address already in use at sun.nio.ch.Net.bind(Native Method) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59) at org.apache.mina.transport.socket.nio.SocketAcceptor.registerNew(SocketAcceptor.java:429) at org.apache.mina.transport.socket.nio.SocketAcceptor.access$900(SocketAcceptor.java:52) at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:258) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43) at java.lang.Thread.run(Thread.java:619) Once all of the existing connections leave FIN_WAIT1 this Exception does not happen and the server starts normally. >> >> I actually don't understand the resolution. >> Shall I open a Jira issue for this? > > Yes, I think you should. If the setReuseAddress(true) is not enough, > then we need to find something else. > > Can you also add some vital information about the version, the JVM and > the system your are using ? ADS 1.0.1 Linux CentOS 4.4, latest patches, java -version: java version "1.6.0" Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) 64-Bit Server VM (build 1.6.0-b105, mixed mode) I will post this all to Jira tomorrow. Cheers. -- http://www.ScheduleWorld.com/ Free Google Calendar synchronization with Outlook, Evolution, cell phones, BlackBerry, PalmOS, Exchange, Mozilla, Thunderbird, Pocket PC/Windows Mobile. Also sync tasks, notes and contacts! WebDAV, vfreebusy, RSS, LDAP, iCalendar, iTIP, iMIP support.