don't retry download after mongorestore errors
@@ -460,6 +460,10 @@ func (s *S3) SourceReader(name string) (io.ReadCloser, error) {
if err == io.EOF {
return
}
+ if errors.Is(err, io.ErrClosedPipe) {
+ s.log.Warning("reader closed pipe, stopping download")
+ return
+ }
s.log.Warning("got %v, try to reconnect in %v", err, time.Second*time.Duration(i+1))
time.Sleep(time.Second * time.Duration(i+1))
