directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Swanson (JIRA)" <j...@apache.org>
Subject [jira] Created: (DIRSERVER-926) Can not restart ADS because SO_REUSEADDR isn't used.
Date Thu, 10 May 2007 16:27:15 GMT
Can not restart ADS because SO_REUSEADDR isn't used.
----------------------------------------------------

                 Key: DIRSERVER-926
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-926
             Project: Directory ApacheDS
          Issue Type: Bug
    Affects Versions: 1.0.1
         Environment: Java 6 build 105, Linux CentOS 4.4.
            Reporter: Mark Swanson


Shutting down ADS leaves all existing connections in FIN_WAIT1. This isn't a problem.
However, when starting up ADS again any previous connection still in FIN_WAIT1 will prevent
ADS from starting.
The only workaround is to wait until all FIN_WAIT1 connections timeout and get closed by the
OS.

On the mailing list Emmanuel already checked this:

This is already done :

...
       try
       {
           // Disable the disconnection of the clients on unbind
           SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig();
           acceptorCfg.setDisconnectOnUnbind( false );
           acceptorCfg.setReuseAddress( true );
... 

The 100% reproducible stack trace when existing FIN_WAIT1 connections are present:

[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.<init>(InitialContext.java:197)
    at javax.naming.directory.InitialDirContext.<init>(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.

Cheers.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message