From bb652cd9a135da8518ef0a711925efe2cfba774b Mon Sep 17 00:00:00 2001 From: Stanislav Chzhen Date: Thu, 12 Oct 2023 19:48:12 +0300 Subject: [PATCH] Pull request 2039: 6304-fix-ring-buffer Updates #6304. Squashed commit of the following: commit 7382630404cf18ff45e54234134c192161f5d94a Author: Stanislav Chzhen Date: Thu Oct 12 19:37:01 2023 +0300 all: upd chlog commit ff9a82a6872f3bd93fe89956c5441429c189bce7 Author: Stanislav Chzhen Date: Thu Oct 12 19:27:35 2023 +0300 querylog: fix ring buffer --- CHANGELOG.md | 6 ++++++ internal/querylog/qlog.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a66abb5a..1166e5ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,12 @@ See also the [v0.107.40 GitHub milestone][ms-v0.107.40]. NOTE: Add new changes BELOW THIS COMMENT. --> +### Fixed + +- Panic on clearing query log ([#6304]). + +[#6304]: https://github.com/AdguardTeam/AdGuardHome/issues/6304 + diff --git a/internal/querylog/qlog.go b/internal/querylog/qlog.go index 988e2b0f..ae058541 100644 --- a/internal/querylog/qlog.go +++ b/internal/querylog/qlog.go @@ -139,7 +139,7 @@ func (l *queryLog) clear() { l.bufferLock.Lock() defer l.bufferLock.Unlock() - l.buffer = nil + l.buffer.Clear() l.flushPending = false }()