Skip to content

Commit

Permalink
fix: correct expToWebhookConfig cache locking (#10014)
Browse files Browse the repository at this point in the history
There is a write under a read lock, causing the master to crash in integration tests with `fatal error: concurrent map writes`.
  • Loading branch information
stoksc authored Oct 3, 2024
1 parent 80b29fa commit ddca766
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions master/internal/webhooks/postgres_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ func (l *WebhookManager) getWebhookConfig(ctx context.Context, expID *int) (*exp
return nil, nil
}

l.mu.RLock()
defer l.mu.RUnlock()
l.mu.Lock()
defer l.mu.Unlock()

if config, ok := l.expToWebhookConfig[*expID]; ok {
return config, nil
Expand Down

0 comments on commit ddca766

Please sign in to comment.