authz: Move locking of emailsCacheMutex
Created by: ryanslade
Before we were locking well before actually making any changes to the map which would hold the lock for too long.
Also added some comments around why we lock in a couple of other places as it wasn't obvious.
Test plan
Existing tests pass
Merge request reports
Activity
Created by: indradhanush
Review: Approved
Changes look good, but just curious how to avoid a future situation when someone accidentally accesses the guarded attribute before it is locked. The current variation would have helped avoid this potential bug.
And out of curiosity, how did you run into this finding?
Please register or sign in to reply