diff --git a/src/modules/kvs/kvs.c b/src/modules/kvs/kvs.c index b9460bbb465d..9d7a254d8b84 100644 --- a/src/modules/kvs/kvs.c +++ b/src/modules/kvs/kvs.c @@ -240,6 +240,7 @@ static int event_unsubscribe (kvs_ctx_t *ctx, const char *ns) { char *setroot_topic = NULL; char *error_topic = NULL; + char *removed_topic = NULL; int rc = -1; if (asprintf (&setroot_topic, "kvs.setroot-%s", ns) < 0) { @@ -262,10 +263,21 @@ static int event_unsubscribe (kvs_ctx_t *ctx, const char *ns) goto cleanup; } + if (asprintf (&removed_topic, "kvs.namespace-removed-%s", ns) < 0) { + errno = ENOMEM; + goto cleanup; + } + + if (flux_event_subscribe (ctx->h, removed_topic) < 0) { + flux_log_error (ctx->h, "flux_event_subscribe"); + goto cleanup; + } + rc = 0; cleanup: free (setroot_topic); free (error_topic); + free (removed_topic); return rc; }