fix lock when dumping the parsing state in explain mode (#2234)
This commit is contained in:
parent
f6924f8c57
commit
6720d89845
1 changed files with 2 additions and 2 deletions
|
@ -326,11 +326,11 @@ func Parse(ctx UnixParserCtx, xp types.Event, nodes []Node) (types.Event, error)
|
||||||
}
|
}
|
||||||
clog.Tracef("node (%s) ret : %v", node.rn, ret)
|
clog.Tracef("node (%s) ret : %v", node.rn, ret)
|
||||||
if ParseDump {
|
if ParseDump {
|
||||||
if len(StageParseCache[stage][node.Name]) == 0 {
|
|
||||||
StageParseMutex.Lock()
|
StageParseMutex.Lock()
|
||||||
|
if len(StageParseCache[stage][node.Name]) == 0 {
|
||||||
StageParseCache[stage][node.Name] = make([]ParserResult, 0)
|
StageParseCache[stage][node.Name] = make([]ParserResult, 0)
|
||||||
StageParseMutex.Unlock()
|
|
||||||
}
|
}
|
||||||
|
StageParseMutex.Unlock()
|
||||||
evtcopy := deepcopy.Copy(event)
|
evtcopy := deepcopy.Copy(event)
|
||||||
parserInfo := ParserResult{Evt: evtcopy.(types.Event), Success: ret}
|
parserInfo := ParserResult{Evt: evtcopy.(types.Event), Success: ret}
|
||||||
StageParseMutex.Lock()
|
StageParseMutex.Lock()
|
||||||
|
|
Loading…
Reference in a new issue