IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 37119


Ignore:
Timestamp:
Jul 24, 2014, 6:20:59 PM (12 years ago)
Author:
watersc1
Message:

bugfix merge.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/ipp-pv3-20140717/ippScripts/scripts/sc_remote_exec.pl

    r37103 r37119  
    209209}
    210210close(RETURN);
    211 
     211print STDERR "Expect $#dbinfo_files dbinfo files\n";
    212212# Binary search it.  BUT: We're binary searching binary values.  So,
    213213# this has to be far more careful than a fully sorted case would be.
     
    221221my $range = 20;  # How wide of a chunk to look through to catch threading drops
    222222my $offset = 0;  # Offset to start from.
    223 if (( stat($dbinfo_files[$last]) )[7] != 0) { $offset = $#dbinfo_files;}
    224 else {
    225     my $count = 0;
    226     while ($first < $last - $range) {
    227 
    228         $mid = int(($last + $first)/2);
    229         for (my $i = 0; $i <= $range; $i++) {
    230             my $size = (stat($dbinfo_files[$mid + $i]))[7];
    231 #           print STDERR "$first $last $mid $i $size $dbinfo_files[$mid + $i]\n";
    232             if ($size == 0) {
    233                 if ($last == $mid + $i) {
    234                     $first = $last - 1;
    235                 }
    236                 $last = $mid + $i;
    237                 $i = $range + 10;
    238             }
    239         }
    240         if ($last > $mid + $range) { $first = $mid + $range; }
    241         $count++;
    242         if ($count > 200) {
    243             &my_die("The iteration loop couldn't converge after 200 rounds, suggesting something has gone wrong.",
    244                     $remote_id,4,"error_run");
    245         }
    246     }
    247     $offset = $mid - $range; # Because I want to make sure I get to the beginning of the thread group.
    248     $offset = $dbindex[$offset]; # Because we need to convert from dbinfo space to returned file space.
    249 }
     223# This doesn't work as well as I'd like, and with the rsync, it's less needed.
     224# if (( stat($dbinfo_files[$last]) )[7] != 0) { $offset = $#dbinfo_files;}
     225# else {
     226#     my $count = 0;
     227#     while ($first < $last - $range) {
     228
     229#       $mid = int(($last + $first)/2);
     230#       for (my $i = 0; $i <= $range; $i++) {
     231#           my $size = (stat($dbinfo_files[$mid + $i]))[7];
     232# #         print STDERR "$first $last $mid $i $size $dbinfo_files[$mid + $i]\n";
     233#           if ($size == 0) {
     234#               if ($last == $mid + $i) {
     235#                   $first = $last - 1;
     236#               }
     237#               $last = $mid + $i;
     238#               $i = $range + 10;
     239#           }
     240#       }
     241#       if ($last > $mid + $range) { $first = $mid + $range; }
     242#       $count++;
     243#       if ($count > 200) {
     244#           &my_die("The iteration loop couldn't converge after 200 rounds, suggesting something has gone wrong.",
     245#                   $remote_id,4,"error_run");
     246#       }
     247#     }
     248#     $offset = $mid - $range; # Because I want to make sure I get to the beginning of the thread group.
     249#     $offset = $dbindex[$offset]; # Because we need to convert from dbinfo space to returned file space.
     250# }
    250251
    251252# Feed teh return list into the transfer tool
     
    255256print "$return_push_output_print\n";
    256257
    257 #die();
     258
    258259
    259260foreach my $file (@dbinfo_files) {
     
    262263    close(DBF);
    263264    chomp($cmd);
     265#    print STDERR "$file $cmd\n";
    264266    $cmd =~ s/-/ -/g; # This is just a safety check for missing space.
    265267    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
     
    269271        # Now we're going to drop the component that owns this dbinfo, which should force a retry.
    270272        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
    271         warn("The command that shouldn't fail has failed: $cmd $remote_id $error_code");
     273        warn("The command that shouldn't fail has failed: $file $cmd $remote_id $error_code");
    272274        drop_component($remote_id,$cmd,$file);
    273275    }
Note: See TracChangeset for help on using the changeset viewer.