From 9adf6f4568d5a6b1c61ff93beb12a45b962c2602 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 5 Oct 2024 00:38:35 +0200 Subject: libstore: remove Goal::notify Goal::work() is a fully usable promise that does not rely on the worker to report completion conditions. as such we no longer need the `notify` field that enabled this interplay. we do have to clear goal caches when destroying the worker though, otherwise goal promises may (incorrectly) keep goals alive due to strong shared pointers created by childStarted. Change-Id: Ie607209aafec064dbdf3464fe207d70ba9ee158a --- src/libstore/build/worker.hh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/libstore/build/worker.hh') diff --git a/src/libstore/build/worker.hh b/src/libstore/build/worker.hh index 6569de6ee..923092b51 100644 --- a/src/libstore/build/worker.hh +++ b/src/libstore/build/worker.hh @@ -96,15 +96,7 @@ private: struct CachedGoal { std::weak_ptr goal; - kj::Own>> promise; - kj::Own>> fulfiller; - - CachedGoal() - { - auto pf = kj::newPromiseAndFulfiller>(); - promise = kj::heap(pf.promise.fork()); - fulfiller = std::move(pf.fulfiller); - } + kj::ForkedPromise> promise{nullptr}; }; /** * Maps used to prevent multiple instantiations of a goal for the -- cgit v1.2.3