From 32cfbe395903890a9df104cbc4c0474033363f13 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 30 Jun 2025 22:22:20 +0200 Subject: [PATCH] drop checkInterrupt from ThreadPool items all of them block on a promise very soon after starting. only queryValidPaths needs to make sure not to swallow Interrupted exceptions to exit quickly instead of trying all paths first. Change-Id: I4f99f5d75d7057bad109dc0131aa58e84275e362 --- lix/libstore/binary-cache-store.cc | 2 -- lix/libstore/store-api.cc | 4 ++-- lix/nix/sigs.cc | 6 ------ lix/nix/verify.cc | 6 +++--- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/lix/libstore/binary-cache-store.cc b/lix/libstore/binary-cache-store.cc index f46d82abe..85232525c 100644 --- a/lix/libstore/binary-cache-store.cc +++ b/lix/libstore/binary-cache-store.cc @@ -226,8 +226,6 @@ try { std::string member, std::string key, std::string target) { - checkInterrupt(); - JSON json; json["archive"] = target; json["member"] = member; diff --git a/lix/libstore/store-api.cc b/lix/libstore/store-api.cc index 64305c9b2..56f1e37f3 100644 --- a/lix/libstore/store-api.cc +++ b/lix/libstore/store-api.cc @@ -760,8 +760,6 @@ try { ThreadPool pool{"queryValidPaths pool"}; auto doQuery = [&](AsyncIoRoot & aio, const StorePath & path) { - checkInterrupt(); - bool exists = false; std::exception_ptr newExc{}; @@ -769,6 +767,8 @@ try { aio.blockOn(queryPathInfo(path)); exists = true; } catch (InvalidPath &) { + } catch (Interrupted &) { + throw; } catch (...) { newExc = std::current_exception(); } diff --git a/lix/nix/sigs.cc b/lix/nix/sigs.cc index 0c497e821..a8ac6f933 100644 --- a/lix/nix/sigs.cc +++ b/lix/nix/sigs.cc @@ -46,9 +46,6 @@ struct CmdCopySigs : StorePathsCommand std::atomic added{0}; auto doPath = [&](AsyncIoRoot & aio, const Path & storePathS) { - - checkInterrupt(); - auto storePath = store->parseStorePath(storePathS); auto info = aio.blockOn(store->queryPathInfo(storePath)); @@ -124,9 +121,6 @@ struct CmdSign : StorePathsCommand std::atomic added{0}; auto doPath = [&](AsyncIoRoot & aio, const Path & storePathS) { - - checkInterrupt(); - auto storePath = store->parseStorePath(storePathS); auto info = aio.blockOn(store->queryPathInfo(storePath)); diff --git a/lix/nix/verify.cc b/lix/nix/verify.cc index 4ebca2582..6feb44294 100644 --- a/lix/nix/verify.cc +++ b/lix/nix/verify.cc @@ -86,8 +86,6 @@ struct CmdVerify : StorePathsCommand auto doPath = [&](AsyncIoRoot & aio, const StorePath & storePath) { try { - checkInterrupt(); - MaintainCount> mcActive(active); update(); @@ -145,7 +143,9 @@ struct CmdVerify : StorePathsCommand if (validSigs >= actualSigsNeeded) break; try { auto info2 = aio.blockOn(store2->queryPathInfo(info->path)); - if (info2->isContentAddressed(*store)) validSigs = ValidPathInfo::maxSigs; + if (info2->isContentAddressed(*store)) { + validSigs = ValidPathInfo::maxSigs; + } doSigs(info2->sigs); } catch (InvalidPath &) { } catch (Error & e) {