From b877a7554a1fa1c47a2982541972efe780dfad9a Mon Sep 17 00:00:00 2001
From: Nicolas Capponi <nicolas.capponi@forgerock.com>
Date: Thu, 11 Jun 2015 13:53:40 +0000
Subject: [PATCH] OPENDJ-1705 File based changelog: handle concurrency between purge and cursors

---
 opendj-server-legacy/src/main/java/org/opends/server/replication/server/MessageHandler.java |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/MessageHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/MessageHandler.java
index a13585c..a5e96ec 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/server/MessageHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/server/MessageHandler.java
@@ -239,8 +239,10 @@
    * @param sendToServerId
    *          serverId of the replica where changes will be sent
    * @return The next update that must be sent to the consumer, or {@code null} when queue is empty
+   * @throws ChangelogException
+   *            If a problem occurs when reading the changelog
    */
-  protected UpdateMsg getNextMessage(int sendToServerId)
+  protected UpdateMsg getNextMessage(int sendToServerId) throws ChangelogException
   {
     while (activeConsumer)
     {
@@ -371,7 +373,7 @@
    * Fills the late queue with the most recent changes, accepting only the
    * messages from provided replica ids.
    */
-  private void fillLateQueue(int sendToServerId)
+  private void fillLateQueue(int sendToServerId) throws ChangelogException
   {
     try (DBCursor<UpdateMsg> cursor = replicationServerDomain.getCursorFrom(serverState);)
     {
@@ -384,10 +386,6 @@
         }
       }
     }
-    catch (ChangelogException e)
-    {
-      logger.traceException(e);
-    }
   }
 
   private boolean isLateQueueBelowThreshold()

--
Gitblit v1.10.0