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
This commit is contained in:
eldritch horrors
2026-05-04 09:44:10 +00:00
parent 078bbe6171
commit 0d2c48a797
2 changed files with 4 additions and 21 deletions
+4 -18
View File
@@ -56,29 +56,15 @@ RemoteStore::RemoteStore(const RemoteStoreConfig & config)
kj::Promise<Result<ref<RemoteStore::Connection>>> 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<Result<ref<RemoteStore::Connection>>> 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();
}
-3
View File
@@ -206,9 +206,6 @@ protected:
narFromPath(const StorePath & path, const Activity * context) override;
private:
std::atomic_bool failed{false};
kj::Promise<Result<void>> copyDrvsFromEvalStore(
const std::vector<DerivedPath> & paths,
std::shared_ptr<Store> evalStore);