IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37258


Ignore:
Timestamp:
Aug 13, 2014, 10:33:22 AM (12 years ago)
Author:
bills
Message:

If request_finish.pl is called with an unknown request type, it attempts to stop
the request with error status. However this rarely used path though the code had
two bugs.

  1. --dbserver is not passed by pstamp.pro so the script can't update the database
  2. the options on the updatereq command were wrong. Need -set_state, -set_fault not -state -fault
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-pv3-20140717/pstamp/scripts/request_finish.pl

    r27874 r37258  
    2020
    2121use PS::IPP::Config qw( :standard );
     22use PS::IPP::PStamp::RequestFile qw( :standard );
    2223
    2324my ( $req_id, $req_name, $req_file, $req_type, $outdir, $product, $dbname, $dbserver, $verbose, $save_temps, $redirect_output );
     25
     26my $ipprc = PS::IPP::Config->new();
    2427
    2528GetOptions(
     
    5760if ($redirect_output) {
    5861    my $logDest = "$outdir/reqfinish.$req_id.log";
    59     my $ipprc = PS::IPP::Config->new();
    6062    $ipprc->redirect_output($logDest);
     63}
     64
     65if (!$dbserver) {
     66    $dbserver =  metadataLookupStr($ipprc->{_siteConfig}, 'PS_DBSERVER');
    6167}
    6268
     
    9096    }
    9197} else {
    92     # Unknown request type.
    93     # Since we don't have a req_name there's not much we can do so just the request's state to stop.
     98    # Unknown request type. Stop job with fault invalid request.
    9499    print STDERR "request  $req_id has unknown reqType $req_type\n" if $verbose;
    95     my $command = "$pstamptool -updatereq -req_id $req_id -state stop -fault $PS_EXIT_DATA_ERROR";
     100
     101    my $command = "$pstamptool -updatereq -req_id $req_id -set_state stop -set_fault $PSTAMP_INVALID_REQUEST";
    96102    $command   .= " -dbname $dbname" if $dbname;
    97103    $command   .= " -dbserver $dbserver" if $dbserver;
Note: See TracChangeset for help on using the changeset viewer.