hang-fix
authorAlastair McKinstry <mckinstry@debian.org>
Sun, 19 Aug 2018 18:06:13 +0000 (19:06 +0100)
committerAlastair McKinstry <mckinstry@debian.org>
Sun, 19 Aug 2018 18:06:13 +0000 (19:06 +0100)
Gbp-Pq: Name hang-fix.patch

orte/orted/pmix/pmix_server_gen.c

index 39850edf17134a94ed61855dd3cee2961ac455a5..d07177e04e3785bf546c94b9bd95400526205a7d 100644 (file)
@@ -859,6 +859,15 @@ void pmix_tool_connected_fn(opal_list_t *info,
 
 }
 
+static void lgcbfn(int sd, short args, void *cbdata)
+{
+    orte_pmix_server_op_caddy_t *cd = (orte_pmix_server_op_caddy_t*)cbdata;
+    if (NULL != cd->cbfunc) {
+        cd->cbfunc(cd->status, cd->cbdata);
+    }
+    OBJ_RELEASE(cd);
+}
+
 void pmix_server_log_fn(opal_process_name_t *requestor,
                         opal_list_t *info,
                         opal_list_t *directives,
@@ -907,6 +916,14 @@ void pmix_server_log_fn(opal_process_name_t *requestor,
     if (NULL != cbfunc) {
         cbfunc(OPAL_SUCCESS, cbdata);
     }
+
+    /* we cannot directly execute the callback here
+     * as it would threadlock - so shift to somewhere
+     * safe */
+    rc = ORTE_SUCCESS;  // unused - silence compiler warning
+    ORTE_PMIX_THREADSHIFT(requestor, NULL, rc,
+                          NULL, NULL, lgcbfn,
+                          cbfunc, cbdata);
 }
 
 int pmix_server_job_ctrl_fn(const opal_process_name_t *requestor,