-
Notifications
You must be signed in to change notification settings - Fork 839
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid acquiring shared lock recursively (#2076)
Per the Go docs for sync.RWMutex, pending calls to RWMutex.Lock() block calls to RWMutex.RLock(). With this understood we can see that the call from getNamespace to getNamespaceByID acquires the read side of the RWMutex twice - any interleaved call to RWMutex.Lock() between those two RLock() calls will cause a deadlock - the Lock() call cannot continue and the second RLock() call also will not continue.
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters