IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27853


Ignore:
Timestamp:
May 4, 2010, 10:02:05 AM (16 years ago)
Author:
bills
Message:

handle various error conditions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_checkdependent.pl

    r27805 r27853  
    3030    'stage_id=i'    =>  \$stage_id,
    3131    'component=s'   =>  \$component,
    32     'imagedb=s'     =>  \$imagedb,      # dbname for images
     32    'imagedb=s'     =>  \$imagedb,      # dbname for images.
    3333    'rlabel=s'      =>  \$rlabel,
    3434    'need_magic'    =>  \$need_magic,
     
    5656}
    5757
     58# Append imagedb to the ippTools
    5859$chiptool    .= " -dbname $imagedb";
    5960$warptool    .= " -dbname $imagedb";
    6061$difftool    .= " -dbname $imagedb";
     62$stacktool   .= " -dbname $imagedb";
    6163$magicdstool .= " -dbname $imagedb";
    62 
    6364
    6465my $ipprc = PS::IPP::Config->new();
     
    6768    $dbserver =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER');
    6869}
    69 
    7070
    7171
     
    107107        and (!$need_magic or $it->{magicked} > 0)) {
    108108
    109     # This Dependency is satisfied. all done
     109    # This Dependency is satisfied. All done!
    110110    my $command = "$pstamptool -updatedependent -set_state full -dep_id $dep_id";
    111111    $command .= " -dbname $dbname" if $dbname;
     
    142142    }
    143143} else {
    144     # update for this component has been queued by hasn't completed yet
     144    # update for this component has been queued by hasn't completed yet or the state is an error state
    145145    # XXX: in this state we aren't checking the dependents anymore. If something goes wrong this
    146146    # will never complete. Consider calling the 'queue_update' functions again just to check. They are relatively cheap
     
    157157
    158158    # temporary hack to deal with data with old burntool tables. This check is now done by pstampparse.pl
    159     # so runs in this state will not get queued
     159    # so runs in this state should not get queued
    160160    if ($stage eq 'chip') {
    161161        my $burntool_state = $it->{burntool_state};
     
    177177    if (!$job_fault and ($stage eq 'chip')) {
    178178        # chip processing is done, start destreaking.
    179         $job_fault = queue_update_magicDSRun($stage, $stage_id, $rlabel, $it->{raw_magicked}, $it->{dsRun_state});
     179        $job_fault = queue_update_magicDSRun($stage, $stage_id, $rlabel, $need_magic, $it->{raw_magicked}, $it->{dsRun_state});
    180180    }
    181181    if ($job_fault) {
     
    194194    my $need_magic = shift;
    195195
     196
    196197    my $dsRun_state;
    197198    my $raw_all_magicked = 1; # this gets cleared if any of the inputs aren't destreaked
     
    201202            $raw_all_magicked &= ($chip->{raw_magicked} > 0);
    202203
    203             if ($chip->{data_state} ne 'update') {
     204            if ($chip->{state} =~ /error/) {
     205                faultJobs('stop', undef, undef, $PSTAMP_GONE);
     206            } elsif (($chip->{data_state} ne 'update') and ($chip->{data_state} ne 'full')) {
    204207                my $command = "$chiptool -setimfiletoupdate -chip_id $chip_id -class_id $chip->{class_id}";
    205208                $command .= " -set_label $rlabel" if $rlabel;
     
    236239    }
    237240
    238     my $status = queue_update_magicDSRun('chip', $chip_id, $rlabel, $raw_all_magicked, $dsRun_state);
     241    my $status = queue_update_magicDSRun('chip', $chip_id, $rlabel, $need_magic, $raw_all_magicked, $dsRun_state);
    239242
    240243    return $status;
     
    255258
    256259    my $warp_id = $metadata->{warp_id};
     260    my $state = $metadata->{state};
     261    if ($state =~ /error/) {
     262        print STDERR "warpRun $warp_id has state $state faulting jobs\n";
     263        faultJobs('stop', undef, undef, $PSTAMP_GONE);
     264        exit 0;
     265    }
     266
    257267    if (!$whole_run) {
    258268        my $skycell = $metadata;
     
    584594    my $stage_id = shift;
    585595    my $rlabel  = shift;
     596    my $need_magic = shift;
    586597    my $input_magicked = shift;
    587598    my $dsRun_state = shift;
    588599
    589     # XXX: this code is only fully coded and tested for chip stage
     600    # XXX: this code assumes that destreaking is handled at the chip stage
    590601    my_die ("queue_update_magicDSRun only works for stage chip", $PS_EXIT_PROG_ERROR) if $stage ne 'chip';
    591602
     
    613624                print "skipping $command\n";
    614625            }
     626        } elsif ($dsRun_state eq 'failed_revert') {
     627            print "magicDSRun.state = $dsRun_state for chipRun $stage_id is in state failed_revert cannot update";
     628            faultJobs('stop', undef, undef, $PSTAMP_NOT_AVAILABLE);
    615629        } else {
    616630            print "magicDSRun.state = $dsRun_state for chipRun $stage_id";
Note: See TracChangeset for help on using the changeset viewer.