From 15b6f87da5ebcb85cb1e75cea1f18304b9f391f0 Mon Sep 17 00:00:00 2001 From: "Dong H. Ahn" Date: Thu, 28 May 2015 08:39:50 -0700 Subject: [PATCH] Break a race between wreckrun's state change and initial jcb notification --- src/modules/libjsc/jstatctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/libjsc/jstatctl.c b/src/modules/libjsc/jstatctl.c index 2856bf61d340..47c0931485fe 100644 --- a/src/modules/libjsc/jstatctl.c +++ b/src/modules/libjsc/jstatctl.c @@ -798,13 +798,13 @@ static int new_job_cb (const char *key, int64_t val, void *arg, int errnum) Jadd_int64 (ss, JSC_STATE_PAIR_NSTATE, (int64_t) js); json_object_object_add (jcb, JSC_STATE_PAIR, ss); + if (invoke_cbs (h, nj, jcb, errnum) < 0) { + flux_log (h, LOG_ERR, "new_job_cb: failed to invoke callbacks"); + } if (reg_jobstate_hdlr (h, path, (KVSSetStringF *) job_state_cb) == -1) { flux_log (h, LOG_ERR, "new_job_cb: reg_jobstate_hdlr: %s", strerror (errno)); } - if (invoke_cbs (h, nj, jcb, errnum) < 0) { - flux_log (h, LOG_ERR, "new_job_cb: failed to invoke callbacks"); - } done: /* always return 0 so that reactor won't return */