From: Miloš Mulač Date: Mon, 4 Aug 2008 12:00:44 +0000 (+0000) Subject: first approximation to JW state computation X-Git-Tag: merge_316_6_after~13 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=7dd9f01bb87f7d76d57cc7c4968d072147fd5f6e;p=jra1mw.git first approximation to JW state computation --- diff --git a/org.glite.lb.state-machine/src/process_event.c b/org.glite.lb.state-machine/src/process_event.c index f4fb147..d4e073d 100644 --- a/org.glite.lb.state-machine/src/process_event.c +++ b/org.glite.lb.state-machine/src/process_event.c @@ -543,6 +543,7 @@ static int processEvent_glite(intJobStat *js, edg_wll_Event *e, int ev_seq, int case EDG_WLL_EVENT_RUNNING: if (USABLE(res, strict)) { js->pub.state = EDG_WLL_JOB_RUNNING; + js->pub.jw_status = EDG_WLL_STAT_WRAPPER_RUNNING; free(js->pub.location); js->pub.location = location_string( edg_wll_SourceToString(EDG_WLL_SOURCE_LRMS), @@ -605,6 +606,7 @@ static int processEvent_glite(intJobStat *js, edg_wll_Event *e, int ev_seq, int rep(js->last_branch_seqcode,js->last_seqcode); } + js->pub.jw_status = EDG_WLL_STAT_PAYLOAD_RUNNING; js->pub.payload_running = 1; load_branch_state(js); } @@ -682,10 +684,14 @@ static int processEvent_glite(intJobStat *js, edg_wll_Event *e, int ev_seq, int if (e->any.source == EDG_WLL_SOURCE_LRMS) { /* Done from JobWrapper is not sufficient for transition * to DONE state according its current definition */ + if (USABLE(res, strict)) { + js->pub.jw_status = EDG_WLL_STAT_DONE; + } break; } if (USABLE(res, strict)) { js->pub.state = EDG_WLL_JOB_DONE; + js->pub.jw_status = EDG_WLL_STAT_DONE; rep(js->pub.reason, e->done.reason); if (fine_res == RET_GOODBRANCH) { js->pub.payload_running = 0; @@ -904,6 +910,13 @@ static int processEvent_glite(intJobStat *js, edg_wll_Event *e, int ev_seq, int js->pub.stateEnterTime = js->pub.lastUpdateTime; js->pub.stateEnterTimes[1 + js->pub.state] = (int)js->pub.lastUpdateTime.tv_sec; + + /* in case of resubmit switch JW status back to unknown */ + if (js->pub.state == EDG_WLL_JOB_WAITING || + js->pub.state == EDG_WLL_JOB_READY || + js->pub.state == EDG_WLL_JOB_SCHEDULED) { + js->pub.jw_status = EDG_WLL_STAT_UNKNOWN; + } } if (e->any.type == EDG_WLL_EVENT_CANCEL) { rep(js->last_cancel_seqcode, e->any.seqcode);