This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.3.8 in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.3.8 by this push: new 0419128 Ticket 50370 - CleanAllRUV task crashing during server shutdown 0419128 is described below
commit 0419128fe0b93714dc43d8de78b91a00583f4d7c Author: Mark Reynolds mreynolds@redhat.com AuthorDate: Tue May 14 13:58:42 2019 -0400
Ticket 50370 - CleanAllRUV task crashing during server shutdown
Description: There is a race condition during server shutdown that can cause the server to crash. Increment the active thread count for each cleaning task to prevent the plugins from being closed before the thread terminates.
https://pagure.io/389-ds-base/issue/50370
Reviewed by: firstyear(Thanks!)
(cherry picked from commit 7141b8d10382e8dcb8528b57e5226c82506b79b9) --- ldap/servers/plugins/replication/repl5_replica_config.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c index a952b68..b4aff9e 100644 --- a/ldap/servers/plugins/replication/repl5_replica_config.c +++ b/ldap/servers/plugins/replication/repl5_replica_config.c @@ -1630,9 +1630,13 @@ replica_cleanallruv_thread(void *arg) int aborted = 0; int rc = 0;
- if (!data) { + if (!data || slapi_is_shutting_down()) { return; /* no data */ } + + /* Increase active thread count to prevent a race condition at server shutdown */ + g_incr_active_threadcnt(); + if (data->task) { slapi_task_inc_refcount(data->task); slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, @@ -1912,6 +1916,7 @@ done: slapi_ch_free_string(&data->force); slapi_ch_free_string(&rid_text); slapi_ch_free((void **)&data); + g_decr_active_threadcnt(); }
/* @@ -3005,9 +3010,13 @@ replica_abort_task_thread(void *arg) int release_it = 0; int count = 0, rc = 0;
- if (!data) { + if (!data || slapi_is_shutting_down()) { return; /* no data */ } + + /* Increase active thread count to prevent a race condition at server shutdown */ + g_incr_active_threadcnt(); + if (data->task) { slapi_task_inc_refcount(data->task); slapi_log_err(SLAPI_LOG_PLUGIN, repl_plugin_name, "replica_abort_task_thread --> refcount incremented.\n"); @@ -3134,6 +3143,7 @@ done: slapi_ch_free_string(&data->certify); slapi_sdn_free(&data->sdn); slapi_ch_free((void **)&data); + g_decr_active_threadcnt(); }
static int
389-commits@lists.fedoraproject.org