directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1634295 - /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
Date Sun, 26 Oct 2014 10:35:20 GMT
Author: kayyagari
Date: Sun Oct 26 10:35:19 2014
New Revision: 1634295

URL: http://svn.apache.org/r1634295
Log:
restart the consumer if disconnected (DIRSERVER-2014)

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

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java?rev=1634295&r1=1634294&r2=1634295&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/consumer/ReplicationConsumerImpl.java
Sun Oct 26 10:35:19 2014
@@ -663,35 +663,24 @@ public class ReplicationConsumerImpl imp
     {
         boolean connected = !disconnected;
 
+        boolean restartSync = false;
+        
         if ( disconnected )
         {
             connected = connect();
+            restartSync = connected;
         }
 
         if ( connected )
         {
             CONSUMER_LOG.debug( "PING : The consumer {} is alive", config.getReplicaId()
);
 
-            try
-            {
-                Entry baseDn = connection.lookup( config.getBaseDn(), "1.1" );
-
-                if ( baseDn == null )
-                {
-                    // Cannot get the entry : this is bad, but possible
-                    CONSUMER_LOG.debug( "Cannot fetch '{}' from provider for consumer {}",
config.getBaseDn(),
-                        config.getReplicaId() );
-                }
-                else
-                {
-                    CONSUMER_LOG.debug( "Fetched '{}' from provider for consumer {}", config.getBaseDn(),
-                        config.getReplicaId() );
-                }
-            }
-            catch ( LdapException le )
+            // DIRSERVER-2014
+            if ( restartSync )
             {
-                // Error : we must disconnect
-                disconnect();
+                CONSUMER_LOG.warn( "Restarting the disconnected consumer {}", config.getReplicaId()
);
+                disconnected = false;
+                startSync();
             }
         }
         else



Mime
View raw message