Blame SOURCES/0007-Ticket-48922-Fix-crash-when-deleting-backend-while-i.patch

7c7f29
From 74df3c57e0de786f001285429501c518d70abb13 Mon Sep 17 00:00:00 2001
7c7f29
From: Mark Reynolds <mreynolds@redhat.com>
7c7f29
Date: Wed, 13 Jul 2016 16:24:19 -0400
7c7f29
Subject: [PATCH 07/15] Ticket 48922 - Fix crash when deleting backend while
7c7f29
 import is running
7c7f29
7c7f29
Bug Description:  If you delete a backend from the config while an
7c7f29
                  import is running the server can crash.
7c7f29
7c7f29
Fix Description:  When deleting a backend from the config wait for the
7c7f29
                  backend instance to not be busy before removing the
7c7f29
                  indexes.  Otherwise the dbenv is not stable and this
7c7f29
                  can cause the crash.
7c7f29
7c7f29
https://fedorahosted.org/389/ticket/48922
7c7f29
7c7f29
Reviewed by: nhosoi(Thanks!)
7c7f29
7c7f29
(cherry picked from commit 6c77c37ae5ce847ffa2bd75287dbd157c2f2d6af)
7c7f29
---
7c7f29
 ldap/servers/slapd/back-ldbm/ldbm_index_config.c | 6 ++++++
7c7f29
 1 file changed, 6 insertions(+)
7c7f29
7c7f29
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_index_config.c b/ldap/servers/slapd/back-ldbm/ldbm_index_config.c
7c7f29
index 3e59e72..c5ceacf 100644
7c7f29
--- a/ldap/servers/slapd/back-ldbm/ldbm_index_config.c
7c7f29
+++ b/ldap/servers/slapd/back-ldbm/ldbm_index_config.c
7c7f29
@@ -151,6 +151,12 @@ ldbm_instance_index_config_delete_callback(Slapi_PBlock *pb, Slapi_Entry* e, Sla
7c7f29
     rc = SLAPI_DSE_CALLBACK_ERROR;
7c7f29
     goto bail;
7c7f29
   }
7c7f29
+
7c7f29
+  while(is_instance_busy(inst)){
7c7f29
+    /* Wait for import/indexing job to complete */
7c7f29
+    DS_Sleep(PR_SecondsToInterval(1));
7c7f29
+  }
7c7f29
+
7c7f29
   *returncode = LDAP_SUCCESS;
7c7f29
   
7c7f29
   slapi_entry_attr_find(e, "cn", &attr);
7c7f29
-- 
7c7f29
2.4.11
7c7f29