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
We've noted a race condition with SetHeaderNormalizer():
funcSetHeaderNormalizer(fNormalizer) {
normalizeName=f// Need to clear the cache hen the header normalizer changes.structInfoCache= sync.Map{}
}
If we have threads currently working and performing operations on structInfoCache, our copying of a blank map into structInfoCache leads to various errors including:
fatal error: sync: unlock of unlocked mutex
structInfoCache should be defined as a *sync.Map{}. When we need to clear the cache, we then should run:
structInfoCache = &sync.Map{}
In-progress calls to the old structInfoCache would complete, and new calls will operate against the new one.
The text was updated successfully, but these errors were encountered:
Hi all.
We've noted a race condition with
SetHeaderNormalizer()
:If we have threads currently working and performing operations on
structInfoCache
, our copying of a blank map intostructInfoCache
leads to various errors including:fatal error: sync: unlock of unlocked mutex
structInfoCache
should be defined as a*sync.Map{}
. When we need to clear the cache, we then should run:structInfoCache = &sync.Map{}
In-progress calls to the old
structInfoCache
would complete, and new calls will operate against the new one.The text was updated successfully, but these errors were encountered: