diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 3188d9330..2373bbdc7 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -1067,27 +1067,15 @@ void RemoteStore::ConnectionHandle::withFramedSink(std::functionto, ex); - fun(sink); - sink.flush(); - } - - stderrThread.join(); - if (ex) - std::rethrow_exception(ex); + FramedSink sink((*this)->to, ex); + fun(sink); + sink.flush(); } }