amoralej / rpms / 389-ds-base

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

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

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