-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notify: Webhook endpoints can fail, but we must start the server. #4060
Conversation
@harshavardhana, thanks for your PR! By analyzing the history of the files in this pull request, we identified @donatello, @balamurugana and @krishnasrinivas to be potential reviewers. |
dc3009d
to
70eb344
Compare
Codecov Report
@@ Coverage Diff @@
## master #4060 +/- ##
==========================================
- Coverage 67.71% 67.64% -0.07%
==========================================
Files 175 175
Lines 24044 24106 +62
==========================================
+ Hits 16281 16307 +26
- Misses 6643 6674 +31
- Partials 1120 1125 +5
Continue to review full report at Codecov.
|
d1ad709
to
ae72ed0
Compare
|
||
// Redo the request with the new redirect url if http 307 | ||
// is returned, quit the loop otherwise | ||
if resp.StatusCode == http.StatusTemporaryRedirect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a TODO here to check later if golang 1.8 follows 307 after POST ?
golang/go#7912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is nothing do for since its already implemented in go1.8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is nothing do for since its already implemented in go1.8?
Yes
cmd/notify-webhook.go
Outdated
// Set proper server user-agent. | ||
req.Header.Set("User-Agent", globalServerUserAgent) | ||
|
||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like 'for' here is only needed to follow redirect urls, can you also add a comment here ?
cmd/notify-webhook.go
Outdated
} | ||
|
||
// isNetErrorRetryable - is network error retryable. | ||
func isNetErrorRetryable(err error) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is supposed to ignore error like 'connection refused' for example when remote port is closed, can you add more comments to understand ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Connection refused is already *net.OpError
..
5a19db4
to
58cfc4c
Compare
Ignore any network errors when registering a webhook notifier during Minio startup sequence. This way server can be started even if the webhook endpoint is not available and unreachable. Fixes minio#4050
58cfc4c
to
fd12f34
Compare
This PR fixes a regression introduced in minio#4060
This PR fixes a regression introduced in minio#4060
This PR fixes a regression introduced in minio#4060
This PR fixes a regression introduced in #4060
Description
Ignore any network errors when registering a webhook
notifier during Minio startup sequence. This way server
can be started even if the webhook endpoint is not available
and unreachable.
Motivation and Context
Fixes #4050
How Has This Been Tested?
Manually with wrong config.
Types of changes
Checklist: