-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
fatal error: concurrent map iteration and map write #74
Comments
hmm yea definitely should be, sounds like a bug to me, thanks for reporting! |
Just an FYI that we're seeing this regularly now. A refinement on the original data, the code is essentially calling |
I have some more info about how this bug occurs:
We can address this in our own code by ensuring that But I wonder if it would also make sense to prevent this type of mistake at the apex/log level?
Either of those options would ensure that no further writes to a fields map can occur that would be concurrent with a call to log something. |
Hi, opening a PR to fix the issue, please let me know if there's anything to improve there :) |
We experienced a crash today that I'm having trouble diagnosing. The error occurred when calling
logger.Info
inside a goroutine. There were several parallel tasks, all which log when they complete. This code has been running, unchanged for months and I don't believe we've had any issues before.Are
logger.WithField
andlogger.WithError
intended to be threadsafe?Thanks in advance.
The error occurs at line 155 in
(e *Entry) mergedFields
The text was updated successfully, but these errors were encountered: