MindscapeHQ/raygun4go

Client is not safe to use for concurrent requests

gsblue opened this issue · 0 comments

The contextInformation struct holds Request, User and CustomData fields which most likely are in context of an error and not the application. In a scenario where the client is instantiated once and shared between multiple concurrent requests (e.g. web api), these fields may get overwritten due to race conditions.

What I propose is to have another type ErrorEntry which holds the Request, User and CustomData fields and is created in context of an error. And then you can use the client to submit the error to raygun. The HandleError method internally will follow the same steps to submit the error.