mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
report write error
This commit is contained in:
parent
10d5b4b32b
commit
9d230521a4
|
@ -170,6 +170,7 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, cipherKe
|
|||
for waitTime := time.Second; waitTime < util.RetryWaitTime; waitTime += waitTime / 2 {
|
||||
for _, urlString := range urlStrings {
|
||||
var localProcessed int
|
||||
var writeErr error
|
||||
shouldRetry, err = util.ReadUrlAsStream(urlString+"?readDeleted=true", cipherKey, isGzipped, isFullChunk, offset, size, func(data []byte) {
|
||||
if totalWritten > localProcessed {
|
||||
toBeSkipped := totalWritten - localProcessed
|
||||
|
@ -180,13 +181,18 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, cipherKe
|
|||
data = data[toBeSkipped:]
|
||||
localProcessed += toBeSkipped
|
||||
}
|
||||
writer.Write(data)
|
||||
localProcessed += len(data)
|
||||
totalWritten += len(data)
|
||||
var writtenCount int
|
||||
writtenCount, writeErr = writer.Write(data)
|
||||
localProcessed += writtenCount
|
||||
totalWritten += writtenCount
|
||||
})
|
||||
if !shouldRetry {
|
||||
break
|
||||
}
|
||||
if writeErr != nil {
|
||||
err = writeErr
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
glog.V(0).Infof("read %s failed, err: %v", urlString, err)
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue