From 1d15200b509c239186ff5bfbe2ef195b82715571 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Thu, 05 Dec 2013 10:07:27 +0000
Subject: [PATCH] #2 Fixed a readWriteLock deadlock happening in tests on calling ChangelogDB.removeDB() which then calls ReplicationDB.shutdown(). Code is blocked acquiring a writeLock on the dbCloseLock, but a readLock is never unlocked. Debugging showed that the ChangeNumberIndexDB is holding a cursor on a ReplicationDB, said cursor holds the readLock. Despite the ChangeNumberIndexer thread being asked to initiateShutdown(), the thread is waiting indefinitely for new changes which will never come.

---
 opends/src/server/org/opends/server/api/DirectoryThread.java |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/api/DirectoryThread.java b/opends/src/server/org/opends/server/api/DirectoryThread.java
index 3b7bd5e..ff3227d 100644
--- a/opends/src/server/org/opends/server/api/DirectoryThread.java
+++ b/opends/src/server/org/opends/server/api/DirectoryThread.java
@@ -416,6 +416,7 @@
   public void initiateShutdown()
   {
     setThreadStateIfNotShuttingDown(ThreadState.SHUTTING_DOWN);
+    interrupt();
   }
 
   /**

--
Gitblit v1.10.0