#50371 Ticket 50370 - CleanAllRUV task crashing during server shutdown
Closed 3 years ago by spichugi. Opened 4 years ago by mreynolds.
mreynolds/389-ds-base ticket50370  into  master

@@ -1677,9 +1677,13 @@ 

      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,
@@ -1959,6 +1963,7 @@ 

      slapi_ch_free_string(&data->force);

      slapi_ch_free_string(&rid_text);

      slapi_ch_free((void **)&data);

+     g_decr_active_threadcnt();

  }

  

  /*
@@ -3051,9 +3056,13 @@ 

      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");
@@ -3180,6 +3189,7 @@ 

      slapi_ch_free_string(&data->certify);

      slapi_sdn_free(&data->sdn);

      slapi_ch_free((void **)&data);

+     g_decr_active_threadcnt();

  }

  

  static int

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

Ack seems reasonable to me!

rebased onto 7141b8d

4 years ago

Pull-Request has been merged by mreynolds

4 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/3430

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago
Metadata