Changeset 35380
- Timestamp:
- Apr 9, 2013, 11:36:27 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/scripts/pstampparse.pl (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/scripts/pstampparse.pl
r35364 r35380 189 189 190 190 # 191 # now convert the request table to an array of metadata config docs191 # now convert the request table to an array of metadatas 192 192 # 193 193 … … 206 206 my $dtime_request_file = gettimeofday() - $start_request_file; 207 207 print "Time to read and parse request file: $dtime_request_file\n"; 208 209 } 208 } 209 210 my $nRows = scalar @$rows; 211 print "\n$nRows rows read from request file\n"; 212 213 # If this is a big request and it came from the upload page and doesn't have a specific label assigned 214 # change it to the generic one that has lower with lower priority 210 215 211 216 # 212 217 # Loop over rows in the request file collecting consecutive rows that have the "same images of interest" 213 # in the sense that their selection parameters will yield the same "Runs".218 # in the sense that their selection parameters will yield the same target "Runs". 214 219 # Process the groups of rows together to reduce lookup time and to potentially make multiple 215 220 # stamps from the same ppstamp process. 216 # 221 217 222 my @rowList; 218 223 my $num_jobs = 0; … … 221 226 my $need_magic; 222 227 foreach my $row (@$rows) { 223 # santiy check the paramaters 228 if ($label eq 'WEB.UP' and ($nRows > 500 or $num_jobs > 500) and $req_id and !$no_update) { 229 $label = 'WEB.BIG'; 230 print "\nChanging label for big WEB.UP request to $label\n"; 231 232 my $command = "$pstamptool -updatereq -req_id $req_id -set_label $label"; 233 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 234 run(command => $command, verbose => $verbose); 235 unless ($success) { 236 my_die("$command failed", $PS_EXIT_UNKNOWN_ERROR); 237 } 238 } 239 # sanity check the paramaters 224 240 if (!checkRow($row)) { 225 241 # when it enconters an error checkRow adds a fake job with an appropriate error code to the database … … 931 947 $command .= ' -hold' if $action eq 'PREVIEW'; 932 948 933 # compute rlabel for the run. 934 # XXX: This bit of policy shouldn't be buried so deeply in the code 935 # For now use one that implies 'postage stamp server' 'update' 'request_label" 936 my $rlabel = "ps_ud_" . $label if $label; 937 $command .= " -rlabel $rlabel" if $rlabel; 949 if ($label) { 950 # compute rlabel for the run. 951 # XXX: This bit of policy shouldn't be buried so deeply in the code 952 # For now use one that implies 'postage stamp server' 'update' 'request_label" 953 my $rlabel = "ps_ud_" . $label; 954 $command .= " -rlabel $rlabel"; 955 } 938 956 939 957 if (!$no_update) { … … 943 961 my $fault = $error_code >> 8; 944 962 print STDERR "$command failed with fault $fault\n"; 945 if ($fault < 10) {963 if ($fault < $PSTAMP_FIRST_ERROR_CODE) { 946 964 # pstamptool returns an error if an existing depenent is faulted 947 # Set the object to not available even if the fault < 10965 # Set the object to not available even if the fault < $PSTAMP_FIRST_ERROR_CODE 948 966 # which is nominally a recoverable error in order to keep 949 967 # the request from faulting (which can be very expensive if … … 951 969 $fault = $PSTAMP_NOT_AVAILABLE 952 970 } 953 if ($fault >= 10) {971 if ($fault >= $PSTAMP_FIRST_ERROR_CODE) { 954 972 $$r_dep_id = 0; 955 973 $$r_fault = $fault;
Note:
See TracChangeset
for help on using the changeset viewer.
