Skip to content

Commit

Permalink
Merge pull request #2009 from AbdelrahmanElawady/fix-data-race
Browse files Browse the repository at this point in the history
Fix data race with hooks map
  • Loading branch information
openshift-merge-bot[bot] committed May 22, 2024
2 parents 9238062 + c1056d1 commit a1de641
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/hooks/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ func (m *Manager) Monitor(ctx context.Context, sync chan<- error) {
for {
select {
case event := <-watcher.Events:
m.lock.Lock()
m.hooks = make(map[string]*current.Hook)
for _, dir := range m.directories {
err = ReadDir(dir, m.extensionStages, m.hooks)
if err != nil {
logrus.Errorf("Failed loading hooks for %s: %v", event.Name, err)
}
}
m.lock.Unlock()
case <-ctx.Done():
err = ctx.Err()
logrus.Debugf("hook monitoring canceled: %v", err)
Expand Down

1 comment on commit a1de641

@packit-as-a-service
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

podman-next COPR build failed. @containers/packit-build please check.

Please sign in to comment.