void UnicoreJob::UpdateUnicoreState( ClassAd *update_ad ) { const char *next_attr_name; ExprTree *next_expr; if ( update_ad == NULL ) { dprintf( D_ALWAYS, "(%d.%d) Received NULL unicore status ad\n", procID.cluster, procID.proc ); return; } update_ad->ResetName(); while ( ( next_attr_name = update_ad->NextNameOriginal() ) != NULL ) { if ( strcasecmp( next_attr_name, ATTR_MY_TYPE ) == 0 || strcasecmp( next_attr_name, ATTR_TARGET_TYPE ) == 0 || strcasecmp( next_attr_name, "UnicoreJobId" ) == 0 ) { continue; } if ( strcasecmp( next_attr_name, ATTR_JOB_STATUS ) == 0 ) { int status = 0; update_ad->LookupInteger( ATTR_JOB_STATUS, status ); unicoreState = status; SetRemoteJobStatus( getJobStatusString( unicoreState ) ); if ( unicoreState == RUNNING ) { JobRunning(); } if ( unicoreState == IDLE ) { JobIdle(); } } next_expr = update_ad->LookupExpr( next_attr_name ); ExprTree * pTree = next_expr->Copy(); jobAd->Insert( next_attr_name, pTree ); } }
void BaseJob::DoneWithJob() { deleteFromGridmanager = true; switch(condorState) { case COMPLETED: { // I never want to see this job again. jobAd->Assign( ATTR_JOB_MANAGED, MANAGED_DONE ); if ( writeUserLog && !terminateLogged ) { WriteTerminateEventToUserLog( jobAd ); EmailTerminateEvent( jobAd, exitStatusKnown ); terminateLogged = true; } deleteFromSchedd = true; } break; case REMOVED: { // I never want to see this job again. jobAd->Assign( ATTR_JOB_MANAGED, MANAGED_DONE ); if ( writeUserLog && !abortLogged ) { WriteAbortEventToUserLog( jobAd ); abortLogged = true; } deleteFromSchedd = true; } break; case HELD: { jobAd->Assign( ATTR_JOB_MANAGED, MANAGED_SCHEDD ); if ( writeUserLog && !holdLogged ) { WriteHoldEventToUserLog( jobAd ); holdLogged = true; } } break; case IDLE: { jobAd->Assign( ATTR_JOB_MANAGED, MANAGED_SCHEDD ); } break; default: { EXCEPT("BaseJob::DoneWithJob called with unexpected state %s (%d)", getJobStatusString(condorState), condorState); } break; } requestScheddUpdate( this, false ); }