Skip to content

Commit

Permalink
Merge pull request #79 from bobbypage/gh_nri_10085
Browse files Browse the repository at this point in the history
Fix deadlock during NRI plugin registration
  • Loading branch information
estesp authored Apr 18, 2024
2 parents 53d3371 + c4893c7 commit fa64d11
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pkg/adaptation/adaptation.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,18 +431,16 @@ func (r *Adaptation) acceptPluginConnections(l net.Listener) error {
continue
}

r.Lock()

err = r.syncFn(ctx, p.synchronize)
if err != nil {
log.Infof(ctx, "failed to synchronize plugin: %v", err)
} else {
r.Lock()
r.plugins = append(r.plugins, p)
r.sortPlugins()
r.Unlock()
}

r.Unlock()

log.Infof(ctx, "plugin %q connected", p.name())
}
}()
Expand Down

0 comments on commit fa64d11

Please sign in to comment.