Skip to content

Commit

Permalink
OSSM-2419 Prevent deadlock between multiNamespaceInformer.lock and na…
Browse files Browse the repository at this point in the history
…mespaceSet.lock (maistra#35)
  • Loading branch information
luksa committed Jan 11, 2023
1 parent 3ae7b65 commit 552cae7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/informers/informer.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,13 @@ func (i *multiNamespaceInformer) AddIndexers(indexers cache.Indexers) error {

// HasSynced checks if each namespaced informer has synced.
func (i *multiNamespaceInformer) HasSynced() bool {
i.lock.Lock()
defer i.lock.Unlock()

if !i.namespaces.Initialized() {
return false
}

i.lock.Lock()
defer i.lock.Unlock()

for _, informer := range i.informers {
if synced := informer.HasSynced(); !synced {
return false
Expand Down

0 comments on commit 552cae7

Please sign in to comment.