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
This problem manifests when running multiple go tests concurrently, when launching multiple instances of objects that use your package at the same time.
Hi.
Logger.log() calls moduleLeveled.Log() which
calls moduleLeveled.GetLevel(), which does a map read.
Now, var defaultBackend LeveledBackend is a global field.
If someone calls concurrently logging.SetLevel(), a map write takes place in moduleLeveled.SetLevel() which results in a panic of "fatal error: concurrent map read and map write".
Is it possible to protect the backend via a read-write lock?
Attached a stack trace that caused a panic:
This problem manifests when running multiple go tests concurrently, when launching multiple instances of objects that use your package at the same time.
Update: I opened a PR
#105
The text was updated successfully, but these errors were encountered: