Merge "libstore: always release build/substitution slot tokens" into main

This commit is contained in:
eldritch horrors 2024-10-19 18:32:30 +00:00 committed by Gerrit Code Review
commit b0e619b8bd

View file

@ -22,6 +22,12 @@ kj::Promise<void> Goal::waitForAWhile()
kj::Promise<Result<Goal::WorkResult>> Goal::work() noexcept
try {
// always clear the slot token, no matter what happens. not doing this
// can cause builds to get stuck on exceptions (or other early exist).
// ideally we'd use scoped slot tokens instead of keeping them in some
// goal member variable, but we cannot do this yet for legacy reasons.
KJ_DEFER({ slotToken = {}; });
BOOST_OUTCOME_CO_TRY(auto result, co_await workImpl());
trace("done");