Changeset 1130
- Timestamp:
- 11/14/07 11:55:09 (1 year ago)
- Files:
-
- trunk/utils/Changes (modified) (1 diff)
- trunk/utils/mogtool (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/utils/Changes
r1126 r1130 1 * Fix the automatic retry on errors saving a chunk (Ask Bjoern Hansen) 2 1 3 * Improve error messages from mogtool (Ask Bjoern Hansen). 2 4 trunk/utils/mogtool
r1126 r1130 800 800 my $dkey = $opts{big} ? "$key,$chunknum" : "$key"; 801 801 802 # TODO: be resilient to transient errors, retry, etc.803 802 my $start_time = [ gettimeofday() ]; 804 803 my $try = 0; 805 804 while (1) { 806 805 $try++; 807 my $fh = $mogfs->new_file($dkey, $opts{class}, $bufsize); 808 unless (defined $fh) { 809 error("WARNING: Unable to create new file '$dkey'."); 810 printf "This was try #$try and it's been %.2f seconds since we first tried. Retrying...\n", tv_interval($start_time); 811 sleep 1; 812 next; 813 } 814 $fh->print($chunkbuf{$cn}); 815 unless ($fh->close) { 816 error("WARNING: Unable to save file '$dkey'."); 806 eval { 807 my $fh = $mogfs->new_file($dkey, $opts{class}, $bufsize); 808 unless (defined $fh) { 809 die "Unable to create new file"; 810 } 811 $fh->print($chunkbuf{$cn}); 812 unless ($fh->close) { 813 die "Close failed"; 814 } 815 }; 816 if (my $err = $@) { 817 error("WARNING: Unable to save file '$dkey': $err"); 817 818 printf "This was try #$try and it's been %.2f seconds since we first tried. Retrying...\n", tv_interval($start_time); 818 819 sleep 1;
