libstore: kill sandboxes before removing paths

otherwise we may end up trying to delete a temporary directory that is
still actively being written to if a derivation is killed due to other
derivations failing or the build is aborted due to a user interruption

fixes #678

Change-Id: I4678723f11bdd261b27af8784d040a787690b107
This commit is contained in:
eldritch horrors
2025-02-23 13:41:37 +00:00
parent c64a9db6bb
commit aaab224bea
+1 -1
View File
@@ -104,9 +104,9 @@ LocalDerivationGoal::~LocalDerivationGoal() noexcept(false)
{
/* Careful: we should never ever throw an exception from a
destructor. */
try { deleteTmpDir(false); } catch (...) { ignoreExceptionInDestructor(); }
try { killChild(); } catch (...) { ignoreExceptionInDestructor(); }
try { stopDaemon(); } catch (...) { ignoreExceptionInDestructor(); }
try { deleteTmpDir(false); } catch (...) { ignoreExceptionInDestructor(); }
}