mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #25651 from 249043822/249043822-patch-1
Automatic merge from submit-queue MatchingCache lock optimize
This commit is contained in:
		@@ -72,8 +72,8 @@ func (c *MatchingCache) Add(labelObj objectWithMeta, selectorObj objectWithMeta)
 | 
				
			|||||||
// we need check in the external request to ensure the cache data is not dirty.
 | 
					// we need check in the external request to ensure the cache data is not dirty.
 | 
				
			||||||
func (c *MatchingCache) GetMatchingObject(labelObj objectWithMeta) (controller interface{}, exists bool) {
 | 
					func (c *MatchingCache) GetMatchingObject(labelObj objectWithMeta) (controller interface{}, exists bool) {
 | 
				
			||||||
	key := keyFunc(labelObj)
 | 
						key := keyFunc(labelObj)
 | 
				
			||||||
	c.mutex.Lock()
 | 
						c.mutex.RLock()
 | 
				
			||||||
	defer c.mutex.Unlock()
 | 
						defer c.mutex.RUnlock()
 | 
				
			||||||
	return c.cache.Get(key)
 | 
						return c.cache.Get(key)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user