From 772852ff4f86e497f4fcc7ca20de937a24c1d6c8 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 21 Jun 2023 10:28:01 -0700 Subject: [PATCH] app/vlselect/logsql: properly handle the error from ParseLogMessage --- app/vlselect/logsql/sort_writer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/vlselect/logsql/sort_writer.go b/app/vlselect/logsql/sort_writer.go index dcb3b8893..919fc8310 100644 --- a/app/vlselect/logsql/sort_writer.go +++ b/app/vlselect/logsql/sort_writer.go @@ -7,6 +7,7 @@ import ( "sync" "github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/logger" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logjson" "github.com/VictoriaMetrics/VictoriaMetrics/lib/logstorage" ) @@ -168,7 +169,9 @@ func (rs *rowsSorter) parseRows(src []byte) { continue } - p.ParseLogMessage(line) + if err := p.ParseLogMessage(line); err != nil { + logger.Panicf("BUG: unexpected invalid JSON line: %s", err) + } timeValue := "" fieldsBufLen := len(fieldsBuf)