forked from lix-project/lix
Revert "libstore: using throwing finally in withFramedSink"
This reverts commit491caad6f6
. this is not actually legal for nix! throwing exceptions in destructors is fine, but the way nix is set up we'll end up throwing the exception we received from the remote *twice* in some cases, and such cases will cause an immediate terminate without active exception. Change-Id:I74c46b9f26fd791086e4193ec60eb1deb9a5bb2a
This commit is contained in:
parent
c77b6e1fdd
commit
ad30972867
|
@ -1067,15 +1067,27 @@ void RemoteStore::ConnectionHandle::withFramedSink(std::function<void(Sink & sin
|
|||
|
||||
Finally joinStderrThread([&]()
|
||||
{
|
||||
stderrThread.join();
|
||||
if (ex) {
|
||||
std::rethrow_exception(ex);
|
||||
if (stderrThread.joinable()) {
|
||||
stderrThread.join();
|
||||
if (ex) {
|
||||
try {
|
||||
std::rethrow_exception(ex);
|
||||
} catch (...) {
|
||||
ignoreException();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
FramedSink sink((*this)->to, ex);
|
||||
fun(sink);
|
||||
sink.flush();
|
||||
{
|
||||
FramedSink sink((*this)->to, ex);
|
||||
fun(sink);
|
||||
sink.flush();
|
||||
}
|
||||
|
||||
stderrThread.join();
|
||||
if (ex)
|
||||
std::rethrow_exception(ex);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue