more info if nodeleave confirmation queries fail

This commit is contained in:
Matt Jaffee 2019-06-20 17:32:57 -05:00
parent fe83ef59c7
commit 481c85acae
No known key found for this signature in database
GPG key ID: 08A3DFFF987B11BF

View file

@ -1709,15 +1709,17 @@ func confirmNodeDown(uri URI, log logger.Logger) bool {
log.Printf("bad request:%s %s", u.String(), err)
return false
}
for i := 0; i < confirmDownRetries; i++ {
resp, err := http.DefaultClient.Do(req.WithContext(ctx))
var bod []byte
if err == nil {
bod, err = ioutil.ReadAll(resp.Body)
if resp.StatusCode == 200 {
return false
}
}
log.Printf("NodeLeave Timeout with %s %d", uri.HostPort(), i)
log.Printf("NodeLeave confirm with %s %d. err: '%v' bod: '%s'", uri.HostPort(), i, err, bod)
time.Sleep(confirmDownSleep * time.Second)
}
return true