Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/controller: Migrate to using a read lock instead of a readwrite lock when checking for any namespace caching errors #2382

Merged
merged 1 commit into from
Sep 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/controller/registry/resolver/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ type NamespacedOperatorCache struct {
func (c *NamespacedOperatorCache) Error() error {
var errs []error
for key, snapshot := range c.snapshots {
snapshot.m.Lock()
snapshot.m.RLock()
err := snapshot.err
snapshot.m.Unlock()
snapshot.m.RUnlock()
if err != nil {
errs = append(errs, fmt.Errorf("error using catalog %s (in namespace %s): %w", key.Name, key.Namespace, err))
}
Expand Down