Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5B42417B2B for ; Sat, 25 Oct 2014 15:23:34 +0000 (UTC) Received: (qmail 58631 invoked by uid 500); 25 Oct 2014 15:23:34 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 58581 invoked by uid 500); 25 Oct 2014 15:23:34 -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 58571 invoked by uid 99); 25 Oct 2014 15:23:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Oct 2014 15:23:34 +0000 Date: Sat, 25 Oct 2014 15:23:34 +0000 (UTC) From: "Kiran Ayyagari (JIRA)" To: dev@directory.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (DIRSERVER-2014) Synchronization is stopped if remote server was not restored during refresh interval MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIRSERVER-2014?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kiran Ayyagari reassigned DIRSERVER-2014: ----------------------------------------- Assignee: Kiran Ayyagari > Synchronization is stopped if remote server was not restored during refresh interval > ------------------------------------------------------------------------------------ > > Key: DIRSERVER-2014 > URL: https://issues.apache.org/jira/browse/DIRSERVER-2014 > Project: Directory ApacheDS > Issue Type: Bug > Components: ldap > Affects Versions: 2.0.0-M16 > Reporter: Alexander Kozlov > Assignee: Kiran Ayyagari > Fix For: 2.0.0-M18 > > > *Steps to reproduce:* > 1. Set up synchronization between two servers S1 and S2 > 2. Stop server S2 > 3. Wait more than refresh interval > 4. Start server S2 > *Observed result:* > S1 never read/update data from S2 > *Reason:* > When connection lost and we tried to reconnect at least one time, _ReplicationConsumerImpl.disconnected_ field become equals to _true_. > ReplicationConsumerImpl: {code} > private ReplicationStatusEnum doRefreshOnly() > { > while ( !disconnected ) > { > CONSUMER_LOG.debug( "==================== Refresh Only ==========" ); > try > { > doSyncSearch( SynchronizationModeEnum.REFRESH_ONLY, reload ); > CONSUMER_LOG.debug( "--------------------- Sleep for {} seconds ------------------", ( config.getRefreshInterval() / 1000 ) ); > Thread.sleep( config.getRefreshInterval() ); > CONSUMER_LOG.debug( "--------------------- syncing again ------------------" ); > } > catch ( InterruptedException ie ) > { > CONSUMER_LOG.warn( "refresher thread interrupted" ); > return ReplicationStatusEnum.DISCONNECTED; > } > catch ( Exception e ) > { > CONSUMER_LOG.error( "Failed to sync with refresh only mode", e ); > return ReplicationStatusEnum.DISCONNECTED; > } > } > return ReplicationStatusEnum.STOPPED; > } > {code} > After _Thread.sleep( config.getRefreshInterval() );_ we exit _while_ loop, and method return _ReplicationStatusEnum.STOPPED_ instead of _DISCONNECTED_. > LdapServer:{code} > public void startReplicationConsumers() throws Exception > { > ............... > do > { > status = consumer.startSync(); > } > while ( status == ReplicationStatusEnum.REFRESH_REQUIRED ); > if ( status == ReplicationStatusEnum.STOPPED ) > { > // Exit the loop > break; > } > ............... > {code} > In that we exit from thread, and our server never try to get updated data from S2.. -- This message was sent by Atlassian JIRA (v6.3.4#6332)