do not spew.Sdump() the invalid node on error. It leads to huge memory usage, especially if the parsers refers ie. datafile (#1550)

This commit is contained in:
Thibault "bui" Koechlin 2022-05-20 13:29:47 +02:00 committed by GitHub
parent 5009e9e483
commit 0483b9c641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -545,12 +545,13 @@ func (n *Node) compile(pctx *UnixParserCtx, ectx EnricherCtx) error {
if !valid {
/* node is empty, error force return */
n.Logger.Infof("Node is empty: %s", spew.Sdump(n))
n.Logger.Error("Node is empty or invalid, abort")
n.Stage = ""
return fmt.Errorf("Node is empty")
}
if err := n.validate(pctx, ectx); err != nil {
return err
//n.logger.Fatalf("Node is invalid : %s", err)
}
return nil
}