Blame SOURCES/0073-Ticket-49209-Hang-due-to-omitted-replica-lock-releas.patch

b7d5c1
From 49ca93665ac6c2faf6077d6a8dc33cbea6bd0fc9 Mon Sep 17 00:00:00 2001
b7d5c1
From: Thierry Bordaz <tbordaz@redhat.com>
b7d5c1
Date: Tue, 4 Apr 2017 10:44:55 +0200
b7d5c1
Subject: [PATCH] Ticket 49209 - Hang due to omitted replica lock release
b7d5c1
b7d5c1
Bug Description:
b7d5c1
    When an operation is canceled (failure), its csn is aborted
b7d5c1
    and removed from the pending list.
b7d5c1
    If at that time the pending list is empty or the csn is not found
b7d5c1
    in that list, the cancel callback forgots to release the replica lock
b7d5c1
b7d5c1
Fix Description:
b7d5c1
    Release replica lock systematically, whether cnsplRemove fails or not
b7d5c1
b7d5c1
https://pagure.io/389-ds-base/issue/49209
b7d5c1
b7d5c1
Reviewed by: Mark Reynolds (thanks Mark !!)
b7d5c1
b7d5c1
Platforms tested: F23
b7d5c1
b7d5c1
Flag Day: no
b7d5c1
b7d5c1
Doc impact: no
b7d5c1
b7d5c1
(cherry picked from commit 7dc991b16b97bacb69ddb334358e27e1220ca27b)
b7d5c1
(cherry picked from commit 071cadabb035fbca354a233adbeba82616be3d19)
b7d5c1
---
b7d5c1
 ldap/servers/plugins/replication/repl5_replica.c | 4 +++-
b7d5c1
 1 file changed, 3 insertions(+), 1 deletion(-)
b7d5c1
b7d5c1
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
b7d5c1
index 602653a..9b3cec5 100644
b7d5c1
--- a/ldap/servers/plugins/replication/repl5_replica.c
b7d5c1
+++ b/ldap/servers/plugins/replication/repl5_replica.c
b7d5c1
@@ -3669,7 +3669,9 @@ abort_csn_callback(const CSN *csn, void *data)
b7d5c1
     {
b7d5c1
         int rc = csnplRemove(r->min_csn_pl, csn);
b7d5c1
         if (rc) {
b7d5c1
-            slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "csnplRemove failed");
b7d5c1
+            slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
b7d5c1
+                    "abort_csn_callback - csnplRemove failed");
b7d5c1
+            replica_unlock(r->repl_lock);
b7d5c1
             return;
b7d5c1
         }
b7d5c1
     }
b7d5c1
-- 
b7d5c1
2.9.3
b7d5c1