From 45623f077fdd53eb227bfee94f061835e86742ff Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 22 Mar 2024 00:57:02 +0100 Subject: libutil: drop Fs{Source,Sink}::good setting this only on exceptions caused by actual fd access is not sufficient to diagnose all errors (such as SerialisationError) in some cases. this usually does not have any negative effects since those errors will end up killing the process in another way. this is not a reliable assumption though and we should be using proper error handling (and closing connections more often, preferring to close over keeping something open that might be in a weird state) Change-Id: I1b792cd7ad8ba9ff0f6bd174945ab2575ff2208e --- src/libstore/remote-store.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/libstore/remote-store.cc') diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 2373bbdc7..2ce047acd 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -39,9 +39,7 @@ RemoteStore::RemoteStore(const Params & params) }, [this](const ref & r) { return - r->to.good() - && r->from.good() - && std::chrono::duration_cast( + std::chrono::duration_cast( std::chrono::steady_clock::now() - r->startTime).count() < maxConnectionAge; } )) @@ -180,6 +178,10 @@ void RemoteStore::ConnectionHandle::processStderr(Sink * sink, Source * source, m.find("Derive([") != std::string::npos) throw Error("%s, this might be because the daemon is too old to understand dependencies on dynamic derivations. Check to see if the raw derivation is in the form '%s'", std::move(m), "DrvWithVersion(..)"); } + // the daemon can still handle more requests, so the connection itself + // is still valid. the current *handle* however should be considered a + // lost cause and abandoned entirely. + handle.release(); throw; } } -- cgit v1.2.3