IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33053


Ignore:
Timestamp:
Jan 9, 2012, 1:45:59 PM (14 years ago)
Author:
bills
Message:

if -tofullskyfile fails wait 10 seconds and try again. We apparently often get a
deadlock in the database during periods of rapid updates

File:
1 edited

Legend:

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

    r32562 r33053  
    373373        # $run_state eq 'update'
    374374        unless ($no_update) {
    375             my $command = "$warptool -tofullskyfile";
    376             $command .= " -warp_id $warp_id";
    377             $command .= " -skycell_id $skycell_id";
    378             $command .= " -set_magicked $magicked" if $magicked;
    379             $command .= " -set_quality $quality" if $quality;
    380             $command .= " -dbname $dbname"   if defined $dbname;
    381 
    382             my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
    383                 run(command => $command, verbose => $verbose);
    384             unless ($success) {
    385                 $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    386                 warn("Unable to perform warptool -addwarped: $error_code\n");
    387                 exit($error_code);
     375            my $try = 0;
     376            while (1) {
     377                $try++;
     378                my $command = "$warptool -tofullskyfile";
     379                $command .= " -warp_id $warp_id";
     380                $command .= " -skycell_id $skycell_id";
     381                $command .= " -set_magicked $magicked" if $magicked;
     382                $command .= " -set_quality $quality" if $quality;
     383                $command .= " -dbname $dbname"   if defined $dbname;
     384
     385                my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     386                    run(command => $command, verbose => $verbose);
     387                unless ($success) {
     388                    $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
     389                    warn("Unable to perform warptool -addwarped: $error_code\n");
     390                    exit($error_code) if $try >= 2;
     391                    sleep 10;
     392                    warn("Trying again\n");
     393                } else {
     394                    last;
     395                }
    388396            }
    389397        }
Note: See TracChangeset for help on using the changeset viewer.