IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37266


Ignore:
Timestamp:
Aug 19, 2014, 1:05:03 PM (12 years ago)
Author:
eugene
Message:

updates to sc_retry_return

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_retry_return.pl

    r37265 r37266  
    3333
    3434# Options
    35 my ($remote_id,$path_base,$job_id,$dbname,$verbose,$no_update,$camera);
     35my ($remote_id,$path_base,$dbname,$verbose,$no_update,$camera);
    3636$force = 0;
    3737$verbose = 0;
    3838GetOptions(
    3939    'remote_id=s'   => \$remote_id,
    40     'job_id=s'      => \$job_id,
    4140    'path_base=s'   => \$path_base,
    4241    'camera=s'      => \$camera,
     
    4746
    4847pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
    49 pod2usage( -msg => "Required options: --remote_id --path_base --job_id", -exitval => 3) unless
     48pod2usage( -msg => "Required options: --remote_id --path_base", -exitval => 3) unless
    5049    defined($path_base) and
    51     defined($remote_id) and
    52     defined($job_id);
     50    defined($remote_id);
    5351
    5452my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $remote_id);
     
    7977my $runData = ${ $rrData2 }[0]; # There should be only one
    8078
    81 # Poll the job status?
     79# my job ID :
     80my $job_id = $runData->{job_id};
     81print "remote job ID: $job_id\n";
     82
     83# Poll the job status? (check status at LANL)
    8284my $poll_response = 0;
    8385my $poll_word  = "nothing";
    84 
    85 if ($force) {
    86     $poll_response = 1;
    87     $poll_word     = "Completed";
    88 }
    89 
    9086($poll_response, $poll_word) = poll_job($job_id);
    9187
    9288if ($poll_response == -1) { # This job has an error
    93     warn("The job exited incorrectly: $remote_id $job_id $poll_word.");
     89    print "The job exited incorrectly: $remote_id $job_id $poll_word $poll_response.\n";
     90    # warn("The job exited incorrectly: $remote_id $job_id $poll_word.");
    9491    exit (2);
    9592}
    9693
    9794if ($poll_response != 1) { # This job has NOT completed
    98 
    99 }
    100 if ($verbose) {
    101     print "Stopped Polling code.  $poll_count of $poll_max $poll_response\n";
    102 }
    103 if ($poll_response != 1) {
    104     warn("Job hasn't completed: $remote_id $job_id $poll_response $poll_word");
    105     exit (1);
     95    print "The job has not exited at LANL: $remote_id $job_id $poll_word $poll_response.\n";
     96    exit (2);
    10697}
    10798
     
    126117
    127118# Feed the return list into the transfer tool
    128 # If this fails, we should go to an auth wait point.
     119# If this fails, we should exit : do not update gpc1 database until all files are back
    129120{
    130121    my $offset = 0;  # Offset to start from.
     
    143134    if (!$transfer_success) &my_die ("failed to get all return files");
    144135}
     136print STDERR "rsync of all files is complete, updating gpc1 database\n";
    145137
    146138foreach my $file (@dbinfo_files) {
     
    169161            next;
    170162        }
     163    } else {
     164        print STDERR "do not know how to handle stage $runData->{stage}\n";
     165        exit (3);
    171166    }
    172167
     
    191186        warn("The command that shouldn't fail has failed: $file $cmd $remote_id $error_code");
    192187        if ($poll_word ne 'Completed') {  # If the job claims it completed, then we're fighting the network.
    193             drop_component($remote_id,$cmd,$file);
     188            # drop_component($remote_id,$cmd,$file);
     189            print STDERR "we should drop this component: $cmd\n";
    194190        }
    195191    }
Note: See TracChangeset for help on using the changeset viewer.