Skip to content

Commit

Permalink
flow: fix data race in new logger implementation (#5179)
Browse files Browse the repository at this point in the history
Signed-off-by: Paschalis Tsilias <[email protected]>
  • Loading branch information
tpaschalis authored Sep 13, 2023
1 parent cb04029 commit fdac7a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/flow/logging/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (h *handler) buildHandler() slog.Handler {
// Fast path: if our cached handler is still valid, immediately return it.
h.mut.RLock()
if h.currentFormat == expectFormat && h.inner != nil {
h.mut.RUnlock()
defer h.mut.RUnlock()
return h.inner
}
h.mut.RUnlock()
Expand Down

0 comments on commit fdac7a0

Please sign in to comment.