From 951514869c3e00b9c0392d10a43d54657f0d4027 Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Thu, 27 May 2010 09:20:00 +0000
Subject: [PATCH] Fix for Issue #4546 : Exception during Replication causes Deadlock When some failure happen in the dbHandler cleaner trimming thread the db shutdown can be called from this thread and should therefore not wait for the trimming thread to complete. This is fixed by setting the done flag before calling the shutdown.

---
 opends/src/server/org/opends/server/replication/server/DbHandler.java |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/DbHandler.java b/opends/src/server/org/opends/server/replication/server/DbHandler.java
index 2ca2e67..72b31c2 100644
--- a/opends/src/server/org/opends/server/replication/server/DbHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/DbHandler.java
@@ -415,6 +415,13 @@
         mb.append(ERR_EXCEPTION_CHANGELOG_TRIM_FLUSH.get());
         mb.append(stackTraceToSingleLineString(end));
         logError(mb.toMessage());
+        synchronized (this)
+        {
+          // set the done variable to true so that this thread don't
+          // get stuck in this dbHandler.shutdown() when it get called
+          // by replicationServer.shutdown();
+          done = true;
+        }
         if (replicationServer != null)
           replicationServer.shutdown();
         break;

--
Gitblit v1.10.0