Webhook endpoints can fail, we must start the server. (#4255)

This PR fixes a regression introduced in #4060
This commit is contained in:
Harshavardhana
2017-05-04 13:43:54 -07:00
committed by Dee Koder
parent a02575ebf9
commit df027a8f51
2 changed files with 48 additions and 3 deletions
+7 -1
View File
@@ -69,10 +69,15 @@ func isNetErrorIgnored(err error) bool {
}
switch err.(type) {
case net.Error:
switch err.(type) {
switch e := err.(type) {
case *net.DNSError, *net.OpError, net.UnknownNetworkError:
return true
case *url.Error:
// Fixes https://github.com/minio/minio/issues/4050
switch e.Err.(type) {
case *net.DNSError, *net.OpError, net.UnknownNetworkError:
return true
}
// For a URL error, where it replies back "connection closed"
// retry again.
if strings.Contains(err.Error(), "Connection closed by foreign host") {
@@ -127,6 +132,7 @@ func lookupEndpoint(urlStr string) error {
resp, derr := client.Do(req)
if derr != nil {
if isNetErrorIgnored(derr) {
errorIf(derr, "Unable to lookup webhook endpoint %s", urlStr)
return nil
}
return derr