QA corner: try to debug failed job state decoding (which leads to memleaks).
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Sat, 9 Feb 2013 21:05:54 +0000 (22:05 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Tue, 26 Feb 2013 14:26:30 +0000 (15:26 +0100)
org.glite.lb.server/src/dump.c
org.glite.lb.server/src/jobstat.c
org.glite.lb.server/src/seqcode.c

index 6953f0b..525f984 100644 (file)
@@ -113,6 +113,10 @@ int edg_wll_DumpEventsServer(edg_wll_Context ctx,const edg_wll_DumpRequest *req,
 
                char *rest;
                stat = dec_intJobStat(res2[4], &rest);
+// DEBUG catch
+if (!rest && stat) {
+       glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_ERROR, "Can't decode status for '%s' during dump", res2[3]);
+}
                //nasty but not the only similar solution in code
                switch (stat->pub.jobtype) {
                        case EDG_WLL_STAT_SIMPLE:
index 7072ac7..7f95d55 100644 (file)
@@ -304,6 +304,10 @@ int edg_wll_JobStatusServer(
                                                        && i < num_sub) {
                                                        if (!strcmp(INTSTAT_VERSION,out_stat[0])) {
                                                                js = dec_intJobStat(out_stat[1], &s_out);
+// DEBUG catch
+if (!s_out && js) {
+       glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_ERROR, "Can't decode status for '%s' during JobStatusServer/EDG_WLL_STAT_CHILDSTAT", out_stat[2]);
+}
                                                                if (s_out != NULL && js != NULL) {
                                                                        stat->children_states[i] = *intJobStat_to_JobStat(js);
                                                                        destroy_intJobStat_extension(js);
@@ -1087,6 +1091,10 @@ edg_wll_ErrorCode edg_wll_LoadIntState(edg_wll_Context ctx,
        if (edg_wll_FetchRow(ctx,sh,1,NULL,&res) < 0) goto cleanup;
 
        *stat = dec_intJobStat(res, &res_rest);
+// DEBUG catch
+if (!res_rest && stat) {
+       glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_ERROR, "Can't decode status for '%s' during LoadIntState()", jobid_md5);
+}
        if (res_rest == NULL) {
                edg_wll_SetError(ctx, EDG_WLL_ERROR_DB_CALL,
                                "error decoding DB intJobStatus");
@@ -1491,6 +1499,10 @@ edg_wll_ErrorCode edg_wll_GetSubjobHistogram(edg_wll_Context ctx, glite_jobid_co
                        // Ready to read the histogram from the record returned
                        rest = (char *)calloc(1,strlen(out));   
                        ijs = dec_intJobStat(out, &rest);
+// DEBUG catch
+if (!rest && ijs) {
+       glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_ERROR, "Can't decode status for '%s' during GetSubjobHistogram()", jobid_md5);
+}
                        for (i=0;i<=EDG_WLL_NUMBER_OF_STATCODES;i++) hist[i] = intJobStat_to_JobStat(ijs)->children_hist[i];
                }
         }
index df09450..ff43e12 100644 (file)
@@ -65,6 +65,10 @@ int edg_wll_QuerySequenceCodeServer(edg_wll_Context ctx, edg_wlc_JobId jobid, co
        if ( edg_wll_FetchRow(ctx, sh, 1, NULL, &res) < 0 ) goto cleanup;
 
        istat = dec_intJobStat(res, &res_rest);
+// DEBUG catch
+if (!res_rest && istat) {
+       glite_common_log(LOG_CATEGORY_LB_SERVER, LOG_PRIORITY_ERROR, "Can't decode status for '%s' during QuerySequenceCodeServer()", jobid_md5);
+}
        if ( res_rest  && istat ) {
                *seqcode = intJobStat_getLastSeqcode(istat);
                intJobStat_nullLastSeqcode(istat);