Changeset 96


Ignore:
Timestamp:
04/20/05 10:35:19 (17 years ago)
Author:
bastiaans
Message:

daemon/togad.py:

  • Empty values will now be properly ignored for dbase
  • Rewrote job ending determination and fixed a bug in it

daemon/job_dbase.sql:

  • Changed constraints on delete; keep nodes, delete job
Location:
trunk/daemon
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/job_dbase.sql

    r92 r96  
    2323CREATE TABLE job_nodes (
    2424        job_id                  INT NOT NULL REFERENCES jobs ON DELETE CASCADE,
    25         node_id                 INT NOT NULL REFERENCES nodes ON DELETE CASCADE,
     25        node_id                 INT NOT NULL REFERENCES nodes ON DELETE RESTRICT,
    2626        PRIMARY KEY ( job_id, node_id )
    2727);
  • trunk/daemon/togad.py

    r90 r96  
    189189                for valname, value in jobattrs.items():
    190190
    191                         if valname in job_values and value:
     191                        if valname in job_values and value != '':
    192192
    193193                                column_name = 'job_' + valname
     
    409409               
    410410                jobinfo = { }
     411                self.jobs_processed = [ ]
    411412
    412413                if name == 'METRIC':
     
    421422                                job_id = metricname.split( 'TOGA-JOB-' )[1]
    422423                                val = attrs.get( 'VAL', "" )
     424
     425                                if not job_id in self.jobs_processed:
     426                                        self.jobs_processed.append( job_id )
    423427
    424428                                check_change = 0
     
    464468                        # it must have finished, since we _did_ get a new heartbeat
    465469                        #
    466                         if jobinfo['reported'] < self.heartbeat and jobinfo['status'] == 'R' and jobid not in self.jobs_to_store:
     470                        mytime = int( jobinfo['reported'] ) + int( jobinfo['poll_interval'] )
     471                        if mytime < self.heartbeat and jobid not in self.jobs_processed and jobinfo['status'] == 'R':
     472
     473                                if not job_id in self.jobs_processed:
     474                                        self.jobs_processed.append( jobid )
    467475
    468476                                self.jobAttrs[ jobid ]['status'] = 'F'
    469477                                self.jobAttrs[ jobid ]['stop_timestamp'] = str( int( jobinfo['reported'] ) + int( jobinfo['poll_interval'] ) )
     478
    470479                                if not jobid in self.jobs_to_store:
    471480                                        self.jobs_to_store.append( jobid )
     
    478487                debug_msg( 1, printTime() + ' - torquexmlthread(): Done storing.' )
    479488
     489                self.jobs_processed = [ ]
    480490                self.jobs_to_store = [ ]
    481491
Note: See TracChangeset for help on using the changeset viewer.