mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
withFramedSink(): Receive interrupts on the stderr thread
Otherwise Nix deadlocks when Ctrl-C is received in withFramedSink():
the parent thread will wait forever for the stderr thread to shut
down.
Fixes the hang reported in https://github.com/NixOS/nix/issues/7245#issuecomment-1770560923.
(cherry picked from commit 24e70489e5
)
This commit is contained in:
parent
b38e5a665e
commit
4b38ebb009
1 changed files with 3 additions and 0 deletions
|
@ -16,6 +16,8 @@
|
|||
#include "logging.hh"
|
||||
#include "callback.hh"
|
||||
#include "filetransfer.hh"
|
||||
#include "signals.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace nix {
|
||||
|
@ -1071,6 +1073,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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue