andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From fb0a01cbb239b75681535e329782e2e6309fc41c Mon Sep 17 00:00:00 2001
dc8c34
From: Mark Reynolds <mreynolds@redhat.com>
dc8c34
Date: Thu, 25 Jul 2013 16:41:01 -0400
dc8c34
Subject: [PATCH 86/99] Ticket 47449 - deadlock after adding and deleting
dc8c34
 entries
dc8c34
dc8c34
Bug Description:  If multiple clients are each doing their own add/delete of the same entries,
dc8c34
                  the server will deadlock very quickly.
dc8c34
dc8c34
Fix Description:  The server was not signaling an error when it failed to lock the parent
dc8c34
                  entry lock.  I've checked add/mod/modrdn functions as well, and they do correctly
dc8c34
                  unlock the cache entry(this includes the old/new superior for modrdn).
dc8c34
dc8c34
https://fedorahosted.org/389/ticket/47449
dc8c34
dc8c34
Reviewed by: richm(Thanks!)
dc8c34
(cherry picked from commit 66fbebc7d4c6552fcbbea7351dea5527d88195a1)
dc8c34
---
dc8c34
 ldap/servers/slapd/back-ldbm/ldbm_delete.c | 7 ++++---
dc8c34
 1 file changed, 4 insertions(+), 3 deletions(-)
dc8c34
dc8c34
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
dc8c34
index 3cf58f4..a3dc17b 100644
dc8c34
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
dc8c34
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
dc8c34
@@ -340,6 +340,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
dc8c34
 			if (parent && cache_lock_entry(&inst->inst_cache, parent)) {
dc8c34
 				/* Failed to obtain parent entry's entry lock */
dc8c34
 				CACHE_RETURN(&(inst->inst_cache), &parent);
dc8c34
+				retval = -1;
dc8c34
 				goto error_return;
dc8c34
 			}
dc8c34
 		}
dc8c34
@@ -509,9 +510,9 @@ ldbm_back_delete( Slapi_PBlock *pb )
dc8c34
 			               "Delete Retrying Transaction\n");
dc8c34
 #ifndef LDBM_NO_BACKOFF_DELAY
dc8c34
 			{
dc8c34
-			PRIntervalTime interval;
dc8c34
-			interval = PR_MillisecondsToInterval(slapi_rand() % 100);
dc8c34
-			DS_Sleep(interval);
dc8c34
+				PRIntervalTime interval;
dc8c34
+				interval = PR_MillisecondsToInterval(slapi_rand() % 100);
dc8c34
+				DS_Sleep(interval);
dc8c34
 			}
dc8c34
 #endif
dc8c34
 		}
dc8c34
-- 
dc8c34
1.8.1.4
dc8c34