From 8a945d6ddb0676b454458e6fe0e9ea6f8b4b5659 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 3 Sep 2020 11:30:15 +0200 Subject: [PATCH] Remove gc-check-reachability --- src/libstore/gc.cc | 16 ---------------- src/libstore/globals.hh | 4 ---- 2 files changed, 20 deletions(-) diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index 81f812604..e6cbc525d 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -101,22 +101,6 @@ Path LocalFSStore::addPermRoot(const StorePath & storePath, const Path & _gcRoot makeSymlink(gcRoot, printStorePath(storePath)); addIndirectRoot(gcRoot); - /* Check that the root can be found by the garbage collector. - !!! This can be very slow on machines that have many roots. - Instead of reading all the roots, it would be more efficient to - check if the root is in a directory in or linked from the - gcroots directory. */ - if (settings.checkRootReachability) { - auto roots = findRoots(false); - if (roots[storePath].count(gcRoot) == 0) - logWarning({ - .name = "GC root", - .hint = hintfmt("warning: '%1%' is not in a directory where the garbage collector looks for roots; " - "therefore, '%2%' might be removed by the garbage collector", - gcRoot, printStorePath(storePath)) - }); - } - /* Grab the global GC root, causing us to block while a GC is in progress. This prevents the set of permanent roots from increasing while a GC is in progress. */ diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index ab9f42ce6..8a2d3ff75 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -293,10 +293,6 @@ public: Setting pollInterval{this, 5, "build-poll-interval", "How often (in seconds) to poll for locks."}; - Setting checkRootReachability{this, false, "gc-check-reachability", - "Whether to check if new GC roots can in fact be found by the " - "garbage collector."}; - Setting gcKeepOutputs{ this, false, "keep-outputs", R"(