Changeset 14 for trunk/gridctl.php


Ignore:
Timestamp:
Jun 29, 2015, 1:39:50 PM (9 years ago)
Author:
gegorbet
Message:

fix to skip all processing where task/job devel/prod do not match

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gridctl.php

    r12 r14  
    4040}
    4141
     42$me_devel  = preg_match( "/class_devel/", $class_dir );
     43
    4244while ( list( $gfacID, $us3_db, $cluster, $status, $queue_msg, $time, $updateTime )
    4345            = mysql_fetch_array( $result ) )
    4446{
     47   // If this entry does not match class/class_devel, skip processing
     48
     49   if ( preg_match( "/US3-A/i", $gfacID ) )
     50   {  // For thrift, job and gridctl must match
     51      $job_devel = preg_match( "/US3-ADEV/i", $gfacID );
     52      if ( (  $me_devel  &&  !$job_devel )  ||
     53           ( !$me_devel  &&   $job_devel ) )
     54      {  // If job not from appropriate Airavata server, skip processing
     55         continue;
     56      }
     57   }
     58   else if ( $me_devel )
     59   {  // For non-thrift and development, skip
     60      continue;
     61   }
     62
    4563   // Checking we need to do for each entry
    4664echo "us3db=$us3_db  gfid=$gfacID\n";
     
    6381   $gfacLabl = $awork[0] . "-" . $awork[1] . "-" . $awork[2];
    6482   $loghdr   = $self . ":" . $gfacLabl . "...:";
     83   $status_in = $status;
     84   $status_gw = $status;
    6585
    6686   // If entry is for Airvata/Thrift, get the true current status
     
    182202      if ( ! in_array( $job_status, array( 'SUBMITTED', 'INITIALIZED', 'PENDING' ) ) )
    183203      {
    184 write_log( "$loghdr submitted:job_status=$job_status" );
     204//write_log( "$loghdr submitted:job_status=$job_status" );
    185205         update_job_status( $job_status, $gfacID );
    186206      }
     
    217237   if ( ! in_array( $job_status, array( 'SUBMITTED', 'INITIALIZED', 'PENDING' ) ) )
    218238   {
     239//write_log( "$loghdr submit_timeout:job_status=$job_status" );
    219240      update_job_status( $job_status, $gfacID );
    220241      return;
     
    260281
    261282      if ( ! in_array( $job_status, array( 'ACTIVE', 'RUNNING', 'STARTED' ) ) )
     283      {
     284//write_log( "$loghdr running:job_status=$job_status" );
    262285         update_job_status( $job_status, $gfacID );
     286      }
    263287
    264288      return;
     
    293317   if ( ! in_array( $job_status, array( 'ACTIVE', 'RUNNING', 'STARTED' ) ) )
    294318   {
     319//write_log( "$loghdr run_timeout:job_status=$job_status" );
    295320      update_job_status( $job_status, $gfacID );
    296321      return;
     
    335360      if ( $job_status != 'DATA' )
    336361      {
     362//write_log( "$loghdr wait_data:job_status=$job_status" );
    337363         update_job_status( $job_status, $gfacID );
    338364         return;
     
    379405   if ( $job_status != 'DATA' )
    380406   {
     407//write_log( "$loghdr data_timeout:job_status=$job_status" );
    381408      update_job_status( $job_status, $gfacID );
    382409      return;
     
    455482   if ( $requestID == 0 ) return;
    456483
     484   $me_devel  = preg_match( "/class_devel/", $class_dir );
     485
    457486   if ( preg_match( "/US3-A/i", $gfacID ) )
    458487   {
    459       $me_devel  = preg_match( "/class_devel/", $class_dir );
    460488      $job_devel = preg_match( "/US3-ADEV/i", $gfacID );
    461489      if ( ( !$me_devel  &&  !$job_devel )  ||
     
    467495//write_log( "$loghdr RTN FR aira_cleanup()" );
    468496   }
    469    else
    470    {
     497
     498   else if ( ! $me_devel )
     499   {  // If this is gridctl_pro and gfac (jureca), do GFAC cleanup
    471500//write_log( "$loghdr CALLING gfac_cleanup()" );
    472501      gfac_cleanup( $us3_db, $requestID, $gLink );
     
    487516    case 'SUBMITED'    :
    488517    case 'INITIALIZED' :
    489     case 'UPDATING'    :
    490     case 'PENDING'     :
    491518      $query   = "UPDATE analysis SET status='SUBMITTED' WHERE gfacID='$gfacID'";
    492       $message = "Job status request reports job is SUBMITTED";
     519      $message = "Job status request reports job is " . $job_status;
     520//write_log( "$loghdr update_job_status(SUBM) job_status=$job_status" );
    493521      break;
    494522
     
    536564      $query   = "UPDATE analysis SET status='ERROR' WHERE gfacID='$gfacID'";
    537565      $message = "Job status request reports job is not in the queue";
     566      break;
     567
     568    case 'UPDATING'    :
     569    case 'PENDING'     :
     570      $message = "Job status request reports job is " . $job_status;
    538571      break;
    539572
     
    627660
    628661   if ( preg_match( "/US3-A/i", $gfacID )  &&
    629         ! preg_match( "/juropa/i", $cluster ) )
     662        ! preg_match( "/jur/i", $cluster ) )
    630663   {
    631664      // Then it's an Airavata/Thrift job
     
    648681      $status_ex    = getExperimentStatus( $gfacID );
    649682      $gfac_status  = standard_status( $status_ex );
     683write_log( "$loghdr get_gfac_status: status_ex=$status_ex gfac_status=$gfac_status" );
    650684      return $gfac_status;
    651685   }
     
    953987         break;
    954988
    955          $status      = 'DATA';
    956          break;
    957 
    958989      case 'COMPLETED' :
    959990      case 'completed' :
     
    10561087      }
    10571088
    1058 if(preg_match("/US3-ADEV/i",$gfacID))
     1089//if(preg_match("/US3-ADEV/i",$gfacID))
     1090if(preg_match("/US3-A/i",$gfacID))
    10591091write_log( "$loghdr status/_in/_gw/_ex=$status/$status_in/$status_gw/$status_ex" );
    10601092//write_log( "$loghdr status/_in/_gw/_ex=$status/$status_in/$status_gw/$status_ex" );
Note: See TracChangeset for help on using the changeset viewer.