IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35465


Ignore:
Timestamp:
May 1, 2013, 3:46:59 PM (13 years ago)
Author:
bills
Message:

don't set state of components to error_cleaned. Prepare code but do not enale
not setting error_cleaned on the runs either. This has been running in the tag for awhile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippScripts/scripts/ipp_cleanup.pl

    r35128 r35465  
    2020my ($stage, $camera, $stage_id, $mode, $path_base, $dbname, $verbose, $no_op, $helplist, $logfile, $check_all);
    2121my $very_verbose = 0;
     22
     23# turn this on to set data_state to error_state for components for which cleanup fails
     24# Note: we no longer do this, we leave the state alone.
     25my $set_error_state_for_file = 0;
     26
     27# turn this on the set the state to error_state when errors occur cleaning up individual components
     28# We may stop doing this
     29my $set_error_state_for_run = 1;
    2230
    2331# this gets set to 1 the first time we set the corresponding destreak run to be cleaned
     
    335343            $num_errors++;
    336344
    337             # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*)
    338             my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -set_state $error_state";
    339             $command .= " -dbname $dbname" if defined $dbname;
    340 
    341             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     345            if ($set_error_state_for_file) {
     346                # if an error happens for one chip, the chipRun will stay in goto_*, but the chips will go to error_* (matching the goto_*)
     347                my $command = "$chiptool -updateprocessedimfile -chip_id $stage_id -class_id $class_id -set_state $error_state";
     348                $command .= " -dbname $dbname" if defined $dbname;
     349
     350                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     351                        run(command => $command, verbose => $verbose);
     352                unless ($success) {
     353                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     354                    &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);
     355                }
     356            }
     357
     358            if ($set_error_state_for_run) {
     359                # We want to flag the run as well, to avoid attempting to reprocess the same data over and over again.
     360                $command = "$chiptool -chip_id $stage_id -updaterun -set_state $error_state";
     361                $command .= " -dbname $dbname" if defined $dbname;
     362
     363                ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    342364                    run(command => $command, verbose => $verbose);
    343             unless ($success) {
    344                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    345                 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);
    346             }
    347 
    348             # We want to flag the run as well, to avoid attempting to reprocess the same data over and over again.
    349             $command = "$chiptool -chip_id $stage_id -updaterun -set_state $error_state";
    350             $command .= " -dbname $dbname" if defined $dbname;
    351 
    352             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    353                 run(command => $command, verbose => $verbose);
    354             unless ($success) {
    355                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    356                 &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);
    357             }
    358 
    359         }
    360     }
    361     if ($num_updated eq 0 and $num_errors eq 0) {
    362         # no chips were updated by this procedssing so set state to $done_state
     365                unless ($success) {
     366                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     367                    &my_die("Unable to perform chiptool: $error_code", "chip", $stage_id, $error_code);
     368                }
     369
     370            }
     371        }
     372    }
     373    # We no longer depend on chiptool to promote the run from goto_cleaned to cleaned based on all of
     374    # the imfiles being in the cleaned state.
     375    # Due to missing files we don't always clean individual components.
     376    # unless there was an error set state to $done_state
     377    if (!$set_error_state_for_run or $num_errors eq 0) {
     378        # set state to $done_state
    363379        my $command = "$chiptool -chip_id $stage_id -updaterun -set_state $done_state";
    364380        $command .= " -dbname $dbname" if defined $dbname;
     
    625641         } else {
    626642            $num_errors++;
    627             my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state";
    628             $command .= " -dbname $dbname" if defined $dbname;
    629 
    630             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    631                 run(command => $command, verbose => $verbose);
    632             unless ($success) {
    633                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    634                 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);
    635             }
    636 
    637             # We want to flag the run as well, to avoid attempting to reprocess the same data over and over again.
    638             $command = "$warptool -warp_id $stage_id -updaterun -set_state $error_state";
    639             $command .= " -dbname $dbname" if defined $dbname;
    640 
    641             ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    642                 run(command => $command, verbose => $verbose);
    643             unless ($success) {
    644                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    645                 &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);
    646             }
    647         }
    648     }
    649     if ($num_updated eq 0 and $num_errors eq 0) {
    650         # no skycells were updated by this procedssing so set state to $done_state
     643            if ($set_error_state_for_file) {
     644                my $command = "$warptool -updateskyfile -warp_id $stage_id -skycell_id $skycell_id -set_state $error_state";
     645                $command .= " -dbname $dbname" if defined $dbname;
     646
     647                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     648                    run(command => $command, verbose => $verbose);
     649                unless ($success) {
     650                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     651                    &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);
     652                }
     653            }
     654
     655            if ($set_error_state_for_run) {
     656                # We want to flag the run as well, to avoid attempting to reprocess the same data over and over again.
     657                $command = "$warptool -warp_id $stage_id -updaterun -set_state $error_state";
     658                $command .= " -dbname $dbname" if defined $dbname;
     659
     660                ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     661                    run(command => $command, verbose => $verbose);
     662                unless ($success) {
     663                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     664                    &my_die("Unable to perform warptool: $error_code", "warp", $stage_id, $error_code);
     665                }
     666            }
     667        }
     668    }
     669    if (!$set_error_state_for_run or $num_errors eq 0) {
     670        # Set run to done state
    651671        my $command = "$warptool -warp_id $stage_id -updaterun -set_state $done_state";
    652672        $command .= " -dbname $dbname" if defined $dbname;
Note: See TracChangeset for help on using the changeset viewer.