andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone

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

b69e47
From bc190eeaaffbb514f69664b4d033dc593a78683b 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
(cherry picked from commit 2ef4e813b8f6b92908ff553a704808cbbd425b5d)
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
b69e47
index 7161bace1..f60df194b 100644
b69e47
--- a/ldap/servers/slapd/back-ldbm/import.c
b69e47
+++ b/ldap/servers/slapd/back-ldbm/import.c
b69e47
@@ -234,7 +234,7 @@ static void import_task_destroy(Slapi_Task *task)
b69e47
         return;
b69e47
     }
b69e47
 
b69e47
-    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