diff options
author | eldritch horrors <pennae@lix.systems> | 2024-10-19 18:32:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-10-19 18:32:30 +0000 |
commit | b0e619b8bd68944de9a721b0b1bfd045dcb77146 (patch) | |
tree | 0aaaccb5b2eba797cab933fbf77618271f899667 /src | |
parent | 60578b4d7d0dfc296c61cae963b6b2763422788e (diff) | |
parent | 564d931134190a88026b74238d534d6b0624adb3 (diff) |
Merge "libstore: always release build/substitution slot tokens" into main
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/build/goal.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstore/build/goal.cc b/src/libstore/build/goal.cc index 02b22b8ad..db16e2cf8 100644 --- a/src/libstore/build/goal.cc +++ b/src/libstore/build/goal.cc @@ -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"); |