From ffc22dd5a175886f9d3661ad5122368ca8022934 Mon Sep 17 00:00:00 2001
From: mrossign <mrossign@localhost>
Date: Thu, 26 Nov 2009 16:38:09 +0000
Subject: [PATCH] Fixed another case where the too slow log message may arrive. This is related to issue 4343 modifications.

---
 opends/src/server/org/opends/server/replication/server/ReplicationServer.java |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/ReplicationServer.java b/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
index ce27179..28a8fc4 100644
--- a/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
+++ b/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -1606,7 +1606,11 @@
     expectedMonitoringMsg =
       Collections.synchronizedList(new ArrayList<GlobalServerId>());
 
-    for (ReplicationServerDomain domain : baseDNs.values())
+    // Copy the list of domains as a new domain may arrive or disappear between
+    // the initializeMonitorData and completeMonitorData calls
+    List<ReplicationServerDomain> rsdList = new ArrayList(baseDNs.values());
+
+    for (ReplicationServerDomain domain : rsdList)
     {
       domain.initializeMonitorData(expectedMonitoringMsg);
     }
@@ -1614,7 +1618,7 @@
     // Wait for responses
     waitMonitorDataResponses();
 
-    for (ReplicationServerDomain domain : baseDNs.values())
+    for (ReplicationServerDomain domain : rsdList)
     {
       domain.completeMonitorData();
     }

--
Gitblit v1.10.0