Skip to content

Commit

Permalink
fix: live reload deadlock (#810)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?

- Live reload deadlock seen in #807

## Short description of the changes

- Move unlock above the callbacks, fix comment

Fixes #807
  • Loading branch information
kentquirk authored Jul 28, 2023
1 parent 81b20d7 commit b3b88a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/file_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,10 +529,10 @@ func (f *fileConfig) monitor() {
f.mainHash = cfg.mainHash
f.rulesConfig = cfg.rulesConfig
f.rulesHash = cfg.rulesHash
f.mux.Unlock() // can't defer -- routine never ends, and callbacks will deadlock
for _, cb := range f.callbacks {
cb()
}
f.mux.Unlock() // can't defer since the goroutine never ends
}
}
}
Expand Down

0 comments on commit b3b88a0

Please sign in to comment.