From 0d2c48a79747c2929942e9eb979f65b5c376287f Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 3 May 2026 16:32:26 +0200 Subject: [PATCH] libstore: remove RemoteStore::failed this is not read in code paths that are called repeatedly, and the only reader can never see it being false. we also question the wisdom of the flag in the first place; why should opening a connection fail because a previous connection did? conditions may have improved a lot since then! Change-Id: Ib7c219e6239432d99a22b10024847218469f1cd4 --- lix/libstore/remote-store.cc | 22 ++++------------------ lix/libstore/remote-store.hh | 3 --- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/lix/libstore/remote-store.cc b/lix/libstore/remote-store.cc index b52d469d0..9783bbf3f 100644 --- a/lix/libstore/remote-store.cc +++ b/lix/libstore/remote-store.cc @@ -56,29 +56,15 @@ RemoteStore::RemoteStore(const RemoteStoreConfig & config) kj::Promise>> RemoteStore::openConnectionWrapper() -try { - if (failed) - throw Error("opening a connection to remote store '%s' previously failed", getUri()); - try { - co_return TRY_AWAIT(openConnection()); - } catch (...) { - failed = true; - throw; - } -} catch (...) { - co_return result::current_exception(); +{ + return openConnection(); } kj::Promise>> RemoteStore::openAndInitConnection() try { auto conn = TRY_AWAIT(openConnection()); - try { - TRY_AWAIT(initConnection(*conn)); - co_return conn; - } catch (...) { - failed = true; - throw; - } + TRY_AWAIT(initConnection(*conn)); + co_return conn; } catch (...) { co_return result::current_exception(); } diff --git a/lix/libstore/remote-store.hh b/lix/libstore/remote-store.hh index 8353efb08..367f05145 100644 --- a/lix/libstore/remote-store.hh +++ b/lix/libstore/remote-store.hh @@ -206,9 +206,6 @@ protected: narFromPath(const StorePath & path, const Activity * context) override; private: - - std::atomic_bool failed{false}; - kj::Promise> copyDrvsFromEvalStore( const std::vector & paths, std::shared_ptr evalStore);