From 214430b916c77fd2304d18ba47d6bbac6aa7c6c4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Fri, 3 Nov 2006 14:21:54 +0000 Subject: [PATCH] distinguish between done_ok and done_fail collection state --- org.glite.lb.server/src/jobstat.c | 8 +++++--- org.glite.lb.server/src/process_event.c | 2 ++ org.glite.lb/project/events.T | 1 + 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/org.glite.lb.server/src/jobstat.c b/org.glite.lb.server/src/jobstat.c index 96f31ca..1eeee75 100644 --- a/org.glite.lb.server/src/jobstat.c +++ b/org.glite.lb.server/src/jobstat.c @@ -710,7 +710,7 @@ err: } -static int log_collectionState_event(edg_wll_Context ctx, edg_wll_JobStatCode state, intJobStat *cis, intJobStat *pis, edg_wll_Event *ce) +static int log_collectionState_event(edg_wll_Context ctx, edg_wll_JobStatCode state, enum edg_wll_StatDone_code done_code, intJobStat *cis, intJobStat *pis, edg_wll_Event *ce) { int ret = 0; @@ -727,6 +727,7 @@ static int log_collectionState_event(edg_wll_Context ctx, edg_wll_JobStatCode st event->collectionState.state = state; + event->collectionState.done_code = done_code; event->collectionState.histogram = hist_to_string(pis->pub.children_hist); edg_wlc_JobIdDup(cis->pub.jobId, &(event->collectionState.child)); event->collectionState.child_event = edg_wll_EventToString(ce->any.type); @@ -771,7 +772,7 @@ static edg_wll_ErrorCode update_parent_status(edg_wll_Context ctx, edg_wll_JobSt if (pis->pub.jobtype == EDG_WLL_STAT_COLLECTION) { /* not RUNNING yet? */ if (pis->pub.state < EDG_WLL_JOB_RUNNING) { - if (log_collectionState_event(ctx, cis->pub.state, cis, pis, ce)) + if (log_collectionState_event(ctx, cis->pub.state, 0, cis, pis, ce)) goto err; } } @@ -785,7 +786,8 @@ static edg_wll_ErrorCode update_parent_status(edg_wll_Context ctx, edg_wll_JobSt if (pis->pub.children_hist[cis->pub.state+1] == pis->pub.children_num) { /* not DONE yet? */ if (pis->pub.state < EDG_WLL_JOB_DONE) { - if (log_collectionState_event(ctx, cis->pub.state, cis, pis, ce)) + if (log_collectionState_event(ctx, cis->pub.state, + cis->pub.done_code, cis, pis, ce)) goto err; } } diff --git a/org.glite.lb.server/src/process_event.c b/org.glite.lb.server/src/process_event.c index b73e2ba..ab94365 100644 --- a/org.glite.lb.server/src/process_event.c +++ b/org.glite.lb.server/src/process_event.c @@ -815,6 +815,8 @@ int processEvent(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char //XXX: will be usefull with some meaningfull seq. code from COLLECTIONSTATE event // if (USABLE(res, strict)) { js->pub.state = new_state; + if (new_state == EDG_WLL_JOB_DONE) + js->pub.done_code = e->collectionState.done_code; // } break; default: diff --git a/org.glite.lb/project/events.T b/org.glite.lb/project/events.T index ed4202f..3dd0211 100644 --- a/org.glite.lb/project/events.T +++ b/org.glite.lb/project/events.T @@ -204,6 +204,7 @@ @type CollectionState State of the collection. int state New collection state. _optional_ + int done_code In case of (state == Done) contains done code string histogram User readable histogram; useful for debugging. jobid child JobId of subjob, which triggered the state change. string child_event Event which triggered the state change. -- 1.8.2.3