aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-13 11:13:30 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-13 11:13:30 -0700
commit2d519c6cb6b2630435142dd6abdc8e5eeb30cd4a (patch)
tree21027fb3b3c900ce204a5527ae4f09674b10f50b
parentb961fcd338c1499fd8f1de9a7e77da4e127dfe65 (diff)
downloadseaweedfs-2d519c6cb6b2630435142dd6abdc8e5eeb30cd4a.tar.xz
seaweedfs-2d519c6cb6b2630435142dd6abdc8e5eeb30cd4a.zip
adjust the retry logic
-rw-r--r--weed/filer/filechunk_manifest.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/filer/filechunk_manifest.go b/weed/filer/filechunk_manifest.go
index 2115e7856..dbc851496 100644
--- a/weed/filer/filechunk_manifest.go
+++ b/weed/filer/filechunk_manifest.go
@@ -143,6 +143,7 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, cipherKe
writer.Write(data)
written += len(data)
})
+ shouldRetry = shouldRetry && written == 0
if !shouldRetry {
break
}
@@ -155,7 +156,7 @@ func retriedStreamFetchChunkData(writer io.Writer, urlStrings []string, cipherKe
break
}
}
- if err != nil && shouldRetry && written > 0 {
+ if err != nil && shouldRetry {
glog.V(0).Infof("retry reading in %v", waitTime)
time.Sleep(waitTime)
} else {