Changeset 37118
- Timestamp:
- Jul 24, 2014, 6:20:23 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/ippScripts/scripts/sc_remote_exec.pl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippScripts/scripts/sc_remote_exec.pl
r37102 r37118 209 209 } 210 210 close(RETURN); 211 211 print STDERR "Expect $#dbinfo_files dbinfo files\n"; 212 212 # Binary search it. BUT: We're binary searching binary values. So, 213 213 # this has to be far more careful than a fully sorted case would be. … … 221 221 my $range = 20; # How wide of a chunk to look through to catch threading drops 222 222 my $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 # } 250 251 251 252 # Feed teh return list into the transfer tool … … 255 256 print "$return_push_output_print\n"; 256 257 257 #die(); 258 258 259 259 260 foreach my $file (@dbinfo_files) { … … 262 263 close(DBF); 263 264 chomp($cmd); 265 # print STDERR "$file $cmd\n"; 264 266 $cmd =~ s/-/ -/g; # This is just a safety check for missing space. 265 267 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 269 271 # Now we're going to drop the component that owns this dbinfo, which should force a retry. 270 272 $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"); 272 274 drop_component($remote_id,$cmd,$file); 273 275 }
Note:
See TracChangeset
for help on using the changeset viewer.
