You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Prevent concurrent reads and writes of client header map
The current implementation resulted in a `concurrent map iteration and map write` error in the Dynatrace Terraform Provider, as `(c *Client) SetHeader(...)` could be called while the map was being read over in `(c *Client) sendWithRetries(...)`. Now the map is protected with a `sync.RWMutex` to prevent this. Furthermore, as the headers should be static between retries, request headers are now set in `(c *Client) acquireLockAndSendWithRetries(...)` rather than `(c *Client) sendWithRetries(...)`. This is important as `sync.RWMutex` should not be reentered by the same reader or writer.
0 commit comments