Fix abort when the GC thread gets an exception

This commit is contained in:
Eelco Dolstra 2017-09-06 11:37:58 +02:00
parent 0b606aad46
commit 1277aab219
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -887,6 +887,8 @@ void LocalStore::autoGC(bool sync)
std::thread([promise{std::move(promise)}, this, avail, getAvail]() mutable { std::thread([promise{std::move(promise)}, this, avail, getAvail]() mutable {
try {
/* Wake up any threads waiting for the auto-GC to finish. */ /* Wake up any threads waiting for the auto-GC to finish. */
Finally wakeup([&]() { Finally wakeup([&]() {
auto state(_state.lock()); auto state(_state.lock());
@ -906,6 +908,12 @@ void LocalStore::autoGC(bool sync)
_state.lock()->availAfterGC = getAvail(); _state.lock()->availAfterGC = getAvail();
} catch (...) {
// FIXME: we could propagate the exception to the
// future, but we don't really care.
ignoreException();
}
}).detach(); }).detach();
} }