do not retry if failed with a non transport related error

This commit is contained in:
Chris Lu 2020-11-26 01:29:30 -08:00
parent b3adb221b2
commit a102157020

View file

@ -22,9 +22,11 @@ func Retry(name string, job func() error) (err error) {
} }
if strings.Contains(err.Error(), "transport") { if strings.Contains(err.Error(), "transport") {
hasErr = true hasErr = true
glog.V(0).Infof("retry %s", name) glog.V(0).Infof("retry %s: err: %v", name, err)
time.Sleep(waitTime) time.Sleep(waitTime)
waitTime += waitTime / 2 waitTime += waitTime / 2
} else {
break
} }
} }
return err return err