mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #53682 from gnufied/fix-lock-usage-desired-state-world
Automatic merge from submit-queue (batch tested with PRs 53678, 53677, 53682, 53673). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Make sure we use rwlocks not just RLock We need to use of rwlock for updating the desired state of world. I think `-race` flag doesn't detects this consistently. Fixes #53590
This commit is contained in:
commit
f3b6fb7add
@ -336,8 +336,8 @@ func (dsw *desiredStateOfWorld) VolumeExists(
|
|||||||
func (dsw *desiredStateOfWorld) SetMultiAttachError(
|
func (dsw *desiredStateOfWorld) SetMultiAttachError(
|
||||||
volumeName v1.UniqueVolumeName,
|
volumeName v1.UniqueVolumeName,
|
||||||
nodeName k8stypes.NodeName) {
|
nodeName k8stypes.NodeName) {
|
||||||
dsw.RLock()
|
dsw.Lock()
|
||||||
defer dsw.RUnlock()
|
defer dsw.Unlock()
|
||||||
|
|
||||||
nodeObj, nodeExists := dsw.nodesManaged[nodeName]
|
nodeObj, nodeExists := dsw.nodesManaged[nodeName]
|
||||||
if nodeExists {
|
if nodeExists {
|
||||||
|
Loading…
Reference in New Issue
Block a user