IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 6, 2009, 5:44:55 PM (17 years ago)
Author:
bills
Message:

Create stamps in workdir area instead of the data store product directory
various changes to improve logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pstamp/scripts/pstamp_queue_requests.pl

    r19265 r21410  
    107107        my $command = "$dsproductls --uri $ds->{uri}/index.txt";
    108108        $command .= " --last_fileset $ds->{lastFileset}" if $ds->{lastFileset};
     109
    109110        my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    110111            run(command => $command, verbose => $verbose);
    111112        unless ($success) {
     113            # dsproductls exit status is the http error code - 300
     114            my $exit_status = $error_code >> 8;
     115
     116            # don't die on "common faults"
     117            # perhaps after some number of these we should mark the data store as disabled
     118            next if ($exit_status == 200);  # 500 cannot connect (data store down)
     119            next if ($exit_status == 104);  # 404 not found
     120#            next if ($exit_status == 100);  # 400 bad request
     121
    112122            die("Unable to perform $command: $error_code");
    113123        }
     
    143153                    run(command => $command, verbose => $verbose);
    144154            unless ($success) {
     155                # we don't want to die here. We need to set lastFileset
     156                # so that we don't re queue requsts that we have proccessed
    145157                die("Unable to perform $command: $error_code");
    146158            }
     
    175187        }
    176188        $lastFileset = $fs_name;
    177         last if ($numFilesets >= $limit);
    178     }
    179 
    180     ## now update the last_fileset column in pstampDataStore
    181     ## XXX: we should perhaps do this while processing each fileset so that if a later
    182     ## one has an error we don't get repeats.
    183 
    184     if ($lastFileset) {
    185         # print "last fileset: $lastFileset\n";
     189
    186190        {
     191        ## now update the last_fileset column in pstampDataStore
    187192        my $command = "$pstamptool -ds_id $ds_id -moddatastore -last_fileset $lastFileset";
    188193        $command .= " -dbname $dbname" if $dbname;
     
    193198            }
    194199        }
     200        last if ($numFilesets >= $limit);
    195201    }
    196202}
Note: See TracChangeset for help on using the changeset viewer.