Blame SOURCES/0010-Ticket-49402-Adding-a-database-entry-with-the-same-d.patch

058656
From 697e01b0ca2d028f0d2cabc47ab2335de93b0491 Mon Sep 17 00:00:00 2001
b69e47
From: Mark Reynolds <mreynolds@redhat.com>
b69e47
Date: Mon, 16 Oct 2017 12:52:46 -0400
b69e47
Subject: [PATCH] Ticket 49402 - Adding a database entry with the same database
b69e47
 name that was deleted hangs server at shutdown
b69e47
b69e47
Bug Description:  At shutdown, after a backend was deleted, which also had a import
b69e47
                  task run, the server hangs at shutdown.  The issue is that the
b69e47
                  import task destructor used the ldbm inst struct to see if it was
b69e47
                  busy, but the inst was freed and the destructor was checking invalid
b69e47
                  memory which caused a false positive on the "busy" check.
b69e47
b69e47
Fix Description:  Do not check if the instance is busy to tell if it's okay to remove
b69e47
                  the task, instead just check the task's state.
b69e47
b69e47
https://pagure.io/389-ds-base/issue/49402
b69e47
b69e47
Reviewed by: lkrispen(Thanks!)
b69e47
b69e47
(cherry picked from commit bc6dbf15c160ac7e6c553133b2b936a981cfb7b6)
b69e47
---
b69e47
 ldap/servers/slapd/back-ldbm/import.c | 2 +-
b69e47
 1 file changed, 1 insertion(+), 1 deletion(-)
b69e47
b69e47
diff --git a/ldap/servers/slapd/back-ldbm/import.c b/ldap/servers/slapd/back-ldbm/import.c
058656
index e8f4a5615..42e2696d3 100644
b69e47
--- a/ldap/servers/slapd/back-ldbm/import.c
b69e47
+++ b/ldap/servers/slapd/back-ldbm/import.c
058656
@@ -244,7 +244,7 @@ import_task_destroy(Slapi_Task *task)
b69e47
         return;
b69e47
     }
b69e47
 
058656
-    while (is_instance_busy(job->inst)) {
b69e47
+    while (task->task_state == SLAPI_TASK_RUNNING) {
b69e47
         /* wait for the job to finish before freeing it */
b69e47
         DS_Sleep(PR_SecondsToInterval(1));
b69e47
     }
b69e47
-- 
b69e47
2.13.6
b69e47