You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Mark Swanson (JIRA)" <ji...@apache.org> on 2007/05/10 18:27:15 UTC
[jira] Created: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
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.
Re: [jira] Created: (DIRSERVER-926) Can not restart ADS because SO_REUSEADDR isn't used.
Posted by Alex Karasulu <ak...@apache.org>.
Perhaps it's not the LDAP or LDAPS service that is causing this. Is there a
chance that we're not
using setReuseAddress( false ) on some other service which is causing this
failure? Perhaps the
NTP service?
This is a long shot since no other services are enabled by default but I
thought I'd throw out
the idea.
Alex
On 5/16/07, Emmanuel Lecharny <el...@gmail.com> wrote:
>
> I have modified the code following your instructions, but I get exactly
> the same behavior (socket already in use) :
> ...
> SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig();
> acceptorCfg.setDisconnectOnUnbind ( false );
> acceptorCfg.setReuseAddress( false );
> acceptorCfg.setFilterChainBuilder( chainBuilder );
> acceptorCfg.setThreadModel( threadModel );
>
> ((SocketSessionConfig)( acceptorCfg.getSessionConfig())).setTcpNoDelay(
> true );
> ((SocketSessionConfig)(acceptorCfg.getSessionConfig())).setReuseAddress
> true );
> ...
>
> There must be something wrong elsewhere.
>
> Emmanuel
>
> On 5/16/07, Trustin Lee <trustin@gmail.com > wrote:
> >
> > On 5/16/07, Alex Karasulu <akarasulu@apache.org > wrote:
> > > I'm beginning to suspect that there may be an issue with MINA
> > here. It
> > > might be
> > > interesting to setup a test server with MINA using the
> > > acceptorCfg.setReuseAddress( true );
> > > feature then checking to see if this problem occurs. If not another
> > service
> > > which may not
> > > be properly configured via MINA may be causing this trace.
> >
> > acceptorCfg.setReuseAddress() should be set to 'false'.
> >
> > Instead, acceptorCfg.getSessionConfig().setReuseAddress(true) should be
> > called.
> >
> > It was a long standing issue, and I thought it's fixed. Let me fix
> > the problem again in the next release.
> >
> > Trustin
> > --
> > what we call human nature is actually human habit
> > --
> > http://gleamynode.net/
> > --
> > PGP Key ID: 0x0255ECA6
> >
>
>
>
> --
> Regards,
> Cordialement,
> Emmanuel Lécharny
> www.iktek.com
Re: [jira] Created: (DIRSERVER-926) Can not restart ADS because SO_REUSEADDR isn't used.
Posted by Emmanuel Lecharny <el...@gmail.com>.
I have modified the code following your instructions, but I get exactly the
same behavior (socket already in use) :
...
SocketAcceptorConfig acceptorCfg = new SocketAcceptorConfig();
acceptorCfg.setDisconnectOnUnbind( false );
acceptorCfg.setReuseAddress( false );
acceptorCfg.setFilterChainBuilder( chainBuilder );
acceptorCfg.setThreadModel( threadModel );
((SocketSessionConfig)(acceptorCfg.getSessionConfig())).setTcpNoDelay(
true );
((SocketSessionConfig)(acceptorCfg.getSessionConfig())).setReuseAddress
true );
...
There must be something wrong elsewhere.
Emmanuel
On 5/16/07, Trustin Lee <tr...@gmail.com> wrote:
>
> On 5/16/07, Alex Karasulu <ak...@apache.org> wrote:
> > I'm beginning to suspect that there may be an issue with MINA here. It
> > might be
> > interesting to setup a test server with MINA using the
> > acceptorCfg.setReuseAddress( true );
> > feature then checking to see if this problem occurs. If not another
> service
> > which may not
> > be properly configured via MINA may be causing this trace.
>
> acceptorCfg.setReuseAddress() should be set to 'false'.
>
> Instead, acceptorCfg.getSessionConfig().setReuseAddress(true) should be
> called.
>
> It was a long standing issue, and I thought it's fixed. Let me fix
> the problem again in the next release.
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>
--
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com
Re: [jira] Created: (DIRSERVER-926) Can not restart ADS because SO_REUSEADDR isn't used.
Posted by Trustin Lee <tr...@gmail.com>.
On 5/16/07, Alex Karasulu <ak...@apache.org> wrote:
> I'm beginning to suspect that there may be an issue with MINA here. It
> might be
> interesting to setup a test server with MINA using the
> acceptorCfg.setReuseAddress( true );
> feature then checking to see if this problem occurs. If not another service
> which may not
> be properly configured via MINA may be causing this trace.
acceptorCfg.setReuseAddress() should be set to 'false'.
Instead, acceptorCfg.getSessionConfig().setReuseAddress(true) should be called.
It was a long standing issue, and I thought it's fixed. Let me fix
the problem again in the next release.
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6
Re: [jira] Created: (DIRSERVER-926) Can not restart ADS because SO_REUSEADDR isn't used.
Posted by Alex Karasulu <ak...@apache.org>.
I'm beginning to suspect that there may be an issue with MINA here. It
might be
interesting to setup a test server with MINA using the
acceptorCfg.setReuseAddress( true );
feature then checking to see if this problem occurs. If not another service
which may not
be properly configured via MINA may be causing this trace.
Alex
[jira] Commented: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
Posted by "Stefan Seelmann (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSERVER-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510967 ]
Stefan Seelmann commented on DIRSERVER-926:
-------------------------------------------
As mentinoned by Alex this issue should be fixed in the 1.0 trunk as we use MINA 1.0.3 now. Are you able to build the 1.0 trunk yourself? See http://directory.apache.org/apacheds/1.0/building.html how to build it.
> 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
> Fix For: 1.0.3
>
>
> 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.
[jira] Commented: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSERVER-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509420 ]
Alex Karasulu commented on DIRSERVER-926:
-----------------------------------------
According to Trustin MINA 1.0.3 fixes this issue which was a bug in MINA that was not corrected by using the proper configuration settings to re use socket addresses. We do however need a confirmation that this issue has been resolved in trunk which is using 1.0.3.
> 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
> Fix For: 1.0.3
>
>
> 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.
[jira] Updated: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSERVER-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Emmanuel Lecharny updated DIRSERVER-926:
----------------------------------------
Fix Version/s: 1.0.3
I _think_ it has been fixed, but I'm not 100% sure.
Can someone check the code ?
> 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
> Fix For: 1.0.3
>
>
> 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.
[jira] Commented: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
Posted by "Mark Swanson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSERVER-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494802 ]
Mark Swanson commented on DIRSERVER-926:
----------------------------------------
The problem must be that cfg.isReuseAddress() == false
In Mina 1.0.0: core/src/main/java/org/apache/mina/transport/socket/nio/SocketAcceptor.java
About line 426:
// Configure the server socket,
SocketAcceptorConfig cfg;
if( req.config instanceof SocketAcceptorConfig )
{
cfg = ( SocketAcceptorConfig ) req.config;
}
else
{
cfg = ( SocketAcceptorConfig ) getDefaultConfig();
}
ssc.socket().setReuseAddress( cfg.isReuseAddress() );
ssc.socket().setReceiveBufferSize(
( ( SocketSessionConfig ) cfg.getSessionConfig() ).getReceiveBufferSize() );
// and bind.
ssc.socket().bind( req.address, cfg.getBacklog() );
Maybe as a quick check we could walk backwards from this point and figure out why this is false.
Ok, I ran this through the debugger and isReuseAddress() == true.
The only possibilities I see are:
1. setReceiveBufferSize() is changing reuseAddress. unlikely
2. Java 6 bind() ignores reuseAddress. unlikely
The Java 6 changelog doesn't give any indication, and I couldn't find any help from Google.
I'm out.
Cheers.
> 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.
[jira] Closed: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSERVER-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Karasulu closed DIRSERVER-926.
-----------------------------------
Resolution: Won't Fix
Fix Version/s: (was: 1.0.3)
1.5.4
I recommend the switch to 1.5.4 since many of these issues have been resolved.
> 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
> Assignee: Alex Karasulu
> Fix For: 1.5.4
>
>
> 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.
[jira] Commented: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
Posted by "Emmanuel Lecharny (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSERVER-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494785 ]
Emmanuel Lecharny commented on DIRSERVER-926:
---------------------------------------------
The problem with this issue is that nobody knows how to fix it !!!
I have set mly TCP stack to shutdwon connexions after 5 seconds to limit the impact (because I'm launching the server several times a day, this is really a burden for me).
If anyone has a better idea...
> 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.
[jira] Assigned: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
Posted by "Alex Karasulu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSERVER-926?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Karasulu reassigned DIRSERVER-926:
---------------------------------------
Assignee: Alex Karasulu
> 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
> Assignee: Alex Karasulu
> Fix For: 1.5.4
>
>
> 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.
[jira] Commented: (DIRSERVER-926) Can not restart ADS because
SO_REUSEADDR isn't used.
Posted by "Mark Swanson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/DIRSERVER-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510951 ]
Mark Swanson commented on DIRSERVER-926:
----------------------------------------
Is there a patch available for this fix so I can try it on my v101 based system?
> 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
> Fix For: 1.0.3
>
>
> 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.