-
Notifications
You must be signed in to change notification settings - Fork 1
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
PLATFORM-9039: webhooks reliability #98
Conversation
b9fdd63
to
744cbfd
Compare
driver/registry_default.go
Outdated
m.rc[name] = rc | ||
m.rwl.Unlock() |
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 was a data race before
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.
a map in Go is not thread-safe
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.
nit: Could we use https://pkg.go.dev/sync#Map instead of manual synchronization?
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.
Yes, you're right.
@@ -540,17 +538,28 @@ func (e *WebHook) execute(ctx context.Context, data *templateContext) error { | |||
return nil | |||
} | |||
|
|||
func parseWebhookResponse(resp *http.Response, id *identity.Identity) (err error) { | |||
func (e *WebHook) parseWebhookResponse(resp *http.Response, id *identity.Identity) (err error) { |
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.
let's try to push it to the upstream
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.
otherwise, we won't have an access to the logger
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.
the logger is only available through e.deps
@@ -934,8 +936,8 @@ func TestWebHooks(t *testing.T) { | |||
// error. | |||
|
|||
var wg sync.WaitGroup | |||
wg.Add(3) // HTTP client does 3 attempts |
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.
that's no longer true assuming this https://github.com/Wikia/kratos/pull/97/files#r1479563845
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## PLATFORM-8899-CR #98 +/- ##
===================================================
Coverage ? 76.58%
===================================================
Files ? 331
Lines ? 22055
Branches ? 0
===================================================
Hits ? 16891
Misses ? 3867
Partials ? 1297 ☔ View full report in Codecov by Sentry. |
// 204: emptyResponse | ||
// 404: jsonError | ||
// 500: jsonError | ||
func (h *Handler) deleteMultifactorCredential(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { |
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.
Related issue(s)
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got the approval (please contact
[email protected]) from the maintainers to push
the changes.
works.
Further Comments