Ignore:
Timestamp:
Aug 29, 2017, 10:52:39 AM (7 years ago)
Author:
djay
Message:

Fix various memory leaks and enhance the callback support. Add the prohibited keyword to the callback section to avoid calling callback for such services.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/prototype-v0/zoo-project/zoo-kernel/service_internal_hpc.c

    r846 r850  
    8080          }
    8181          free(tmp[i]->name);
     82          if(tmp[i]->format!=NULL)
     83            free(tmp[i]->format);
    8284          tmp[i]->format=zStrdup("ComplexData");
    8385          freeMap(&tmp[i]->content);
     
    160162    cur=cur->next;
    161163  }
     164  //dumpElements((*s)->outputs);
    162165}
    163166
     
    351354  }
    352355 
    353   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
    354   fflush(stderr);
    355   invokeCallback(m,inputs,NULL,3,0);
    356   fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
    357   fflush(stderr);
    358 
    359356  // Produce the SBATCH File locally
    360357  char *scriptPath=(char*)malloc((strlen(s->name)+strlen(tmpPath->value)+strlen(uuid->value)+10)*sizeof(char));
     
    489486      setMapInMaps(*main_conf,"lenv","message",_("Unable to fetch the remote error log file"));
    490487    tmpPath=getMapFromMaps(*main_conf,"lenv","message");
     488    fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
     489    fflush(stderr);
    491490    invokeCallback(m,NULL,NULL,7,1);
     491    fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
     492    fflush(stderr);
    492493    sprintf(tmpS, "Cannot execute the HPC ZOO-Service %s: %s", s->name, tmpPath->value);
    493494    errorException(m,tmpS,"NoApplicableCode",NULL);
     
    533534        sleep(1);
    534535        setMapInMaps(*main_conf,"lenv","message",_("Read closed"));
     536        invokeCallback(m,NULL,NULL,7,1);
    535537        return -1;
    536538      }else{
    537539        if(rc<0){
    538540          setMapInMaps(*main_conf,"lenv","message",_("Read error"));
     541          invokeCallback(m,NULL,NULL,7,1);
    539542          return -1;
    540543        }
     
    543546      res=atoi(buf);
    544547      unlink(sname);
    545       //free(sname); 
     548      //free(sname);
    546549
    547550      if(res==3){
     
    597600          input=input->next;
    598601        }
     602        fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
     603        fflush(stderr);
     604        invokeCallback(m,NULL,outputs,5,1);
     605        fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
     606        fflush(stderr);
    599607      }
    600608      //free(buf);
     
    607615    }
    608616  }
     617  fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
     618  fflush(stderr);
    609619  ssh_close(*main_conf);
     620  fprintf(stderr,"************************* %s %d \n\n",__FILE__,__LINE__);
     621  fflush(stderr);
    610622  return res;
    611623}
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png