From: Otto Moerbeek Date: Mon, 25 Mar 2024 13:34:28 +0000 (+0100) Subject: Comment fixes, some of them only made sense for the non-shared setup X-Git-Tag: rec-5.1.0-alpha1~77^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4342c78e4799c4b4d858542684b46803fa9904a9;p=thirdparty%2Fpdns.git Comment fixes, some of them only made sense for the non-shared setup --- 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); }