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