Skip to content

Commit

Permalink
plugin: call notify_destroy() early
Browse files Browse the repository at this point in the history
Problem: plugin hangs in px_destroy() in RHEL 7 / spack
environment.

notify_destroy() is being called after PMIx_server_finalize(),
but it calls PMIx_Deregister_event_handler() which is probably
a "thread shifted" call.

Change the ordering of px_destroy() so that notify_destroy()
is called before PMIx_server_finalize().

Fixes flux-framework#44
  • Loading branch information
garlick committed Oct 18, 2021
1 parent a6c5038 commit 546c3c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/shell/plugins/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ static void px_destroy (struct px *px)
if (px) {
int rc;
int saved_errno = errno;
notify_destroy (px->notify);
if ((rc = PMIx_server_finalize ()) != PMIX_SUCCESS)
shell_warn ("PMIx_server_finalize: %s", PMIx_Error_string (rc));
notify_destroy (px->notify);
abort_destroy (px->abort);
fence_destroy (px->fence);
dmodex_destroy (px->dmodex);
Expand Down
3 changes: 2 additions & 1 deletion src/shell/plugins/notify.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#include <pmix_server.h>
#include "interthread.h"

/* N.B. notify_create() must be called after PMIx_server_init().
/* N.B. notify_create() must be called after PMIx_server_init()
* and notify_destroy() must be called before PMIx_server_finalize().
*/
struct notify *notify_create (flux_shell_t *shell, struct interthread *it);
void notify_destroy (struct notify *notify);
Expand Down

0 comments on commit 546c3c7

Please sign in to comment.