From 470553bd0572c4010407acb4e410b45a521e5f11 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 1 May 2013 13:21:39 +0200 Subject: [PATCH] Don't let stderr writes in substituters cause a deadlock --- src/libstore/local-store.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index 687ad7e47..dce57f751 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -1007,6 +1007,10 @@ void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter & fromPipe.create(); errorPipe.create(); + /* Hack: prevent substituters that write too much to stderr from + deadlocking our read() from stdout. */ + fcntl(errorPipe.writeSide, F_SETFL, O_NONBLOCK); + setSubstituterEnv(); run.pid = maybeVfork();