More info from CREAM.
authorJiří Filipovič <fila@ics.muni.cz>
Fri, 26 Feb 2010 16:14:22 +0000 (16:14 +0000)
committerJiří Filipovič <fila@ics.muni.cz>
Fri, 26 Feb 2010 16:14:22 +0000 (16:14 +0000)
org.glite.lb.server/src/jobstat_supp.c
org.glite.lb.server/src/lb_html.c
org.glite.lb.state-machine/src/process_event_cream.c

index ef39317..3e5467f 100644 (file)
@@ -542,6 +542,7 @@ static char *enc_JobStat(char *old, edg_wll_JobStat* stat)
        if (ret) ret = enc_string(ret, stat->cream_endpoint);
        if (ret) ret = enc_string(ret, stat->cream_jdl);
        if (ret) ret = enc_string(ret, stat->cream_reason);
+       if (ret) ret = enc_string(ret, stat->cream_failure_reason);
        if (ret) ret = enc_string(ret, stat->cream_lrms_id);
        if (ret) ret = enc_string(ret, stat->cream_node);
        if (ret) ret = enc_int(ret, stat->cream_done_code);
@@ -645,6 +646,7 @@ static edg_wll_JobStat* dec_JobStat(char *in, char **rest)
        if (tmp_in != NULL) stat->cream_endpoint = dec_string(tmp_in, &tmp_in);
        if (tmp_in != NULL) stat->cream_jdl = dec_string(tmp_in, &tmp_in);
        if (tmp_in != NULL) stat->cream_reason = dec_string(tmp_in, &tmp_in);
+       if (tmp_in != NULL) stat->cream_failure_reason = dec_string(tmp_in, &tmp_in);
        if (tmp_in != NULL) stat->cream_lrms_id = dec_string(tmp_in, &tmp_in);
        if (tmp_in != NULL) stat->cream_node = dec_string(tmp_in, &tmp_in);
        if (tmp_in != NULL) stat->cream_done_code = dec_int(tmp_in, &tmp_in);
index bfacfea..8738360 100644 (file)
@@ -267,7 +267,9 @@ int edg_wll_CreamJobStatusToHTML(edg_wll_Context ctx UNUSED_VAR, edg_wll_JobStat
        free(creamstat);
        TR("Owner", "%s", stat.cream_owner);
        TR("Endpoint", "%s", stat.cream_endpoint);
+       TR("Worker node", "%s", stat.cream_node);
        TR("Reason", "%s", stat.cream_reason);
+       TR("Failure reason", "%s", stat.cream_failure_reason);
        
        if ( (stat.stateEnterTime.tv_sec) || (stat.stateEnterTime.tv_usec) ) {
                 time_t  time = stat.stateEnterTime.tv_sec;
index d2286ad..e65fd76 100644 (file)
@@ -95,6 +95,11 @@ int processEvent_Cream(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict,
                                        default:
                                                break;
                                }
+                               if (e->CREAMStore.reason){
+                                       if (js->pub.cream_reason) 
+                                               free(js->pub.cream_reason);
+                                       js->pub.cream_reason = strdup(e->CREAMStore.reason);
+                               }
                        }
                        if (USABLE_DATA(res)) {
                        }
@@ -109,6 +114,10 @@ int processEvent_Cream(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict,
                                        // BLAH -> LRMS
                                                js->pub.state = EDG_WLL_JOB_SCHEDULED;
                                                js->pub.cream_state = EDG_WLL_STAT_IDLE;
+                                               if (e->CREAMStore.reason){
+                                                       free(js->pub.cream_reason);
+                                                       js->pub.cream_reason = strdup(e->CREAMStore.reason);
+                                               }
                                        }
        
                                if (USABLE_DATA(res)) {
@@ -170,10 +179,21 @@ int processEvent_Cream(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict,
                                }
                                if (e->CREAMStatus.exit_code && strcmp(e->CREAMStatus.exit_code, "N/A"))
                                        js->pub.cream_exit_code = atoi(e->CREAMStatus.exit_code);
-                               if (js->pub.cream_node) free(js->pub.cream_node);
-                               js->pub.cream_node = strdup(e->CREAMStatus.worker_node);
-                               if (js->pub.cream_lrms_id) free(js->pub.cream_lrms_id);
-                               js->pub.cream_lrms_id = strdup(e->CREAMStatus.LRMS_jobid);
+                               if (e->CREAMStatus.worker_node){ /*XXX should never be false */
+                                       if (js->pub.cream_node) 
+                                               free(js->pub.cream_node);
+                                       js->pub.cream_node = strdup(e->CREAMStatus.worker_node);
+                               }
+                               if (e->CREAMStatus.LRMS_jobid){ /*XXX should never be false */
+                                       if (js->pub.cream_lrms_id) 
+                                               free(js->pub.cream_lrms_id);
+                                       js->pub.cream_lrms_id = strdup(e->CREAMStatus.LRMS_jobid);
+                               }
+                               if (e->CREAMStatus.failure_reason){
+                                       if (js->pub.cream_failure_reason) 
+                                               free(js->pub.cream_failure_reason);
+                                       js->pub.cream_failure_reason = strdup(e->CREAMStatus.failure_reason);
+                               }
                        }
                        break;