From 4342c78e4799c4b4d858542684b46803fa9904a9 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 25 Mar 2024 14:34:28 +0100 Subject: [PATCH] Comment fixes, some of them only made sense for the non-shared setup --- pdns/recursordist/nod.cc | 10 +++++----- pdns/recursordist/nod.hh | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pdns/recursordist/nod.cc b/pdns/recursordist/nod.cc index 4aae73d97a..75aed78a05 100644 --- a/pdns/recursordist/nod.cc +++ b/pdns/recursordist/nod.cc @@ -50,11 +50,11 @@ void PersistentSBF::remove_tmp_files(const filesystem::path& path, std::lock_gua } } -// This looks for an old (per-thread) snapshot. The first one it finds, -// it restores from that. Then immediately snapshots with the current thread id,// before removing the old snapshot -// In this way, we can have per-thread SBFs, but still snapshot and restore. -// The mutex has to be static because we can't have multiple (i.e. per-thread) -// instances iterating and writing to the cache dir at the same time +// This looks for the newest (per-thread) snapshot it can find and it restores from that. Then +// immediately snapshots with the current thread id, before removing the old snapshot. +// In this way, we can have per-thread SBFs, but still snapshot and restore. The mutex has to be +// static because we can't have multiple (i.e. per-thread) instances iterating and writing to the +// cache dir at the same time bool PersistentSBF::init(bool ignore_pid) { auto log = g_slog->withName("nod"); diff --git a/pdns/recursordist/nod.hh b/pdns/recursordist/nod.hh index 2a5bb3edf4..fb59c35100 100644 --- a/pdns/recursordist/nod.hh +++ b/pdns/recursordist/nod.hh @@ -55,13 +55,11 @@ public: bool snapshotCurrent(std::thread::id tid); // Write the current file out to disk void add(const std::string& data) { - // The only time this should block is when snapshotting d_sbf.lock()->add(data); } bool test(const std::string& data) { return d_sbf.lock()->test(data); } bool testAndAdd(const std::string& data) { - // The only time this should block is when snapshotting return d_sbf.lock()->testAndAdd(data); } -- 2.47.2