From 96aa3761fc87c77237b30635ebd09da573e805fa Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 28 Jan 2022 12:12:56 +0200 Subject: [PATCH] lib/storage/table.go: add missing `tb.ptwsLock.Unlock()` before the return This is a follow-up for a1083d0531a0f40c399bfa5e50262c513d4d858b See https://github.com/VictoriaMetrics/VictoriaMetrics/pull/2103 --- lib/storage/table.go | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/storage/table.go b/lib/storage/table.go index 80f35449ce..c75d548b35 100644 --- a/lib/storage/table.go +++ b/lib/storage/table.go @@ -362,6 +362,7 @@ func (tb *table) AddRows(rows []rawRow) error { pt, err := createPartition(r.Timestamp, tb.smallPartitionsPath, tb.bigPartitionsPath, tb.getDeletedMetricIDs, tb.retentionMsecs) if err != nil { // Return only the first error, since it has no sense in returning all errors. + tb.ptwsLock.Unlock() return fmt.Errorf("errors while adding rows to table %q: %w", tb.path, err) } pt.AddRows(missingRows[i : i+1])