-
Notifications
You must be signed in to change notification settings - Fork 267
Open
Description
Using github.com/sendgrid/sendgrid-go v3.14.0, it appears that Client is not safe for concurrent use.
I was running a service with the race detector enabled, and it detected a data race at:
github.com/sendgrid/sendgrid-go.(*Client).SendWithContext()
/vendor/github.com/sendgrid/sendgrid-go/base_interface.go:65 +0x8c
The problem is (at least) this line:
cl.Body = mail.GetRequestBody(email)
If the client is called concurrently, there is a data race in writing the email parameter to the Body field.
Ideally, the assignment should either be protected by a mutex, or even better, the parameter should not be assigned to any field.
Otherwise, it would be great if you could document that the client is not safe for concurrent use.
kokoichi206, hiromaily, YaroslavPodorvanov, shimingwu and jared-mackey
Metadata
Metadata
Assignees
Labels
No labels