Skip to content

Commit

Permalink
fix: change inner req hdr caused race (#782)
Browse files Browse the repository at this point in the history
#775 doesn't really fix the problem.
Since we already create the wrapper, we should pass the wrapper
directly to OnLog, instead of setting the reqHdr field.

Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander authored Oct 28, 2024
1 parent f5e0d14 commit e0c9ce2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions api/pkg/filtermanager/filtermanager_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ func (m *filterManager) OnLog(reqHdr capi.RequestHeaderMap, reqTrailer capi.Requ
wrappedReqHdr := &filterManagerRequestHeaderMap{
RequestHeaderMap: reqHdr,
}
m.hdrLock.Lock()
m.reqHdr = wrappedReqHdr
m.hdrLock.Unlock()
m.runOnLogPhase(m.reqHdr, reqTrailer, rspHdr, rspTrailer)
m.runOnLogPhase(wrappedReqHdr, reqTrailer, rspHdr, rspTrailer)
}

func wrapFilterManager(fm *filterManager) capi.StreamFilter {
Expand Down

0 comments on commit e0c9ce2

Please sign in to comment.