directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1518658 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Date Thu, 29 Aug 2013 14:14:04 GMT
Author: kayyagari
Date: Thu Aug 29 14:14:04 2013
New Revision: 1518658

URL: http://svn.apache.org/r1518658
Log:
o start consumers after starting the network, and
o do not wait for the consumers to start (DIRSERVER-1894)

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=1518658&r1=1518657&r2=1518658&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Thu Aug 29 14:14:04 2013
@@ -33,8 +33,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
 
 import javax.net.ssl.KeyManagerFactory;
 
@@ -494,9 +492,6 @@ public class LdapServer extends Director
         // Install the replication handler if we have one
         startReplicationProducer();
 
-        // And start the replication consumers on this server
-        startReplicationConsumers();
-
         for ( Transport transport : transports )
         {
             if ( !( transport instanceof TcpTransport ) )
@@ -548,6 +543,10 @@ public class LdapServer extends Director
             startNetwork( transport, chain );
         }
 
+        // And start the replication consumers on this server
+        // these should be started only after starting the network see DIRSERVER-1894
+        startReplicationConsumers();
+
         started = true;
 
         LOG.info( "Ldap service started." );
@@ -711,9 +710,6 @@ public class LdapServer extends Director
             {
                 consumer.init( getDirectoryService() );
 
-                // A counter to be decremented when the consumer thread is started
-                final CountDownLatch counter = new CountDownLatch( 1 );
-
                 Runnable consumerTask = new Runnable()
                 {
                     public void run()
@@ -733,8 +729,6 @@ public class LdapServer extends Director
 
                                 if ( isConnected )
                                 {
-                                    // Ok, we are connected, we can signal the parent that
all is ok
-                                    counter.countDown();
                                     pingerThread.addConsumer( consumer );
 
                                     // We are now connected, start the replication
@@ -766,9 +760,6 @@ public class LdapServer extends Director
                 Thread consumerThread = new Thread( consumerTask );
                 consumerThread.setDaemon( true );
                 consumerThread.start();
-                
-                // Wait for the consumer thread to be started
-                counter.await( 60, TimeUnit.SECONDS );
             }
         }
     }



Mime
View raw message