-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
97381: kvserver: prevent recursive Replica.mu.RLock r=tbg a=pavelkalinnikov Previously, we were passing an RLocked Replica to addToReplicasByKeyLocked. That method internally visits the descriptors in replicasByKey, which calls Desc() that may cause a recursive call to RLock if the added replica intersects itself. This is only possible in tests which try to reinsert the Replica to the map; in prod code each Replica is inserted to replicasByKey only once. This PR avoids the possibility of this deadlock by shifting the responsibility of locking to the caller. Fixes #96931 Release note: none Epic: none Co-authored-by: Pavel Kalinnikov <[email protected]>
- Loading branch information
Showing
5 changed files
with
19 additions
and
22 deletions.
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
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
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