Changeset 37266
- Timestamp:
- Aug 19, 2014, 1:05:03 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-pv3-20140717/ippScripts/scripts/sc_retry_return.pl
r37265 r37266 33 33 34 34 # Options 35 my ($remote_id,$path_base,$ job_id,$dbname,$verbose,$no_update,$camera);35 my ($remote_id,$path_base,$dbname,$verbose,$no_update,$camera); 36 36 $force = 0; 37 37 $verbose = 0; 38 38 GetOptions( 39 39 'remote_id=s' => \$remote_id, 40 'job_id=s' => \$job_id,41 40 'path_base=s' => \$path_base, 42 41 'camera=s' => \$camera, … … 47 46 48 47 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 49 pod2usage( -msg => "Required options: --remote_id --path_base --job_id", -exitval => 3) unless48 pod2usage( -msg => "Required options: --remote_id --path_base", -exitval => 3) unless 50 49 defined($path_base) and 51 defined($remote_id) and 52 defined($job_id); 50 defined($remote_id); 53 51 54 52 my $ipprc = PS::IPP::Config->new( $camera ) or my_die( "Unable to set up", $remote_id); … … 79 77 my $runData = ${ $rrData2 }[0]; # There should be only one 80 78 81 # Poll the job status? 79 # my job ID : 80 my $job_id = $runData->{job_id}; 81 print "remote job ID: $job_id\n"; 82 83 # Poll the job status? (check status at LANL) 82 84 my $poll_response = 0; 83 85 my $poll_word = "nothing"; 84 85 if ($force) {86 $poll_response = 1;87 $poll_word = "Completed";88 }89 90 86 ($poll_response, $poll_word) = poll_job($job_id); 91 87 92 88 if ($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."); 94 91 exit (2); 95 92 } 96 93 97 94 if ($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); 106 97 } 107 98 … … 126 117 127 118 # 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 129 120 { 130 121 my $offset = 0; # Offset to start from. … … 143 134 if (!$transfer_success) &my_die ("failed to get all return files"); 144 135 } 136 print STDERR "rsync of all files is complete, updating gpc1 database\n"; 145 137 146 138 foreach my $file (@dbinfo_files) { … … 169 161 next; 170 162 } 163 } else { 164 print STDERR "do not know how to handle stage $runData->{stage}\n"; 165 exit (3); 171 166 } 172 167 … … 191 186 warn("The command that shouldn't fail has failed: $file $cmd $remote_id $error_code"); 192 187 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"; 194 190 } 195 191 }
Note:
See TracChangeset
for help on using the changeset viewer.
