Merge pull request #9687 from edolstra/withFramedSink-ctrl-c-hang

withFramedSink(): Receive interrupts on the stderr thread

(cherry picked from commit 965cfe96886c988c3aa94bfc7fefdd37325f4536)
Change-Id: I8320a96957c01ec0e3450d1b3ae38a3baff78d49
This commit is contained in:
eldritch horrors 2024-03-04 07:40:17 +01:00
parent 137673de56
commit 8f5d0d4c05
3 changed files with 5 additions and 0 deletions

View file

@ -217,6 +217,8 @@ void PathSubstitutionGoal::tryToRun()
thr = std::thread([this]() {
try {
ReceiveInterrupts receiveInterrupts;
/* Wake up the worker loop when we're done. */
Finally updateStats([this]() { outPipe.writeSide.close(); });

View file

@ -1071,6 +1071,7 @@ void RemoteStore::ConnectionHandle::withFramedSink(std::function<void(Sink & sin
std::thread stderrThread([&]()
{
try {
ReceiveInterrupts receiveInterrupts;
processStderr(nullptr, nullptr, false);
} catch (...) {
ex = std::current_exception();

View file

@ -77,6 +77,8 @@ void ThreadPool::process()
void ThreadPool::doWork(bool mainThread)
{
ReceiveInterrupts receiveInterrupts;
if (!mainThread)
interruptCheck = [&]() { return (bool) quit; };