From 9dbfe242e3bdbfc7728a36c8a2b9fbbea2c8ed68 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 8 Dec 2006 15:44:00 +0000 Subject: * Kill a build if it has gone for more than a certain number of seconds without producing output on stdout or stderr (NIX-65). This timeout can be specified using the `--max-silent-time' option or the `build-max-silent-time' configuration setting. The default is infinity (0). * Fix a tricky race condition: if we kill the build user before the child has done its setuid() to the build user uid, then it won't be killed, and we'll potentially lock up in pid.wait(). So also send a conventional kill to the child. --- src/libstore/globals.hh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libstore/globals.hh') diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index fbb9e19d6ab6..51fa68594798 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -62,6 +62,11 @@ extern bool readOnlyMode; /* The canonical system name, as returned by config.guess. */ extern string thisSystem; +/* The maximum time in seconds that a builer can go without producing + any output on stdout/stderr before it is killed. 0 means + infinity. */ +extern unsigned int maxSilentTime; + Strings querySetting(const string & name, const Strings & def); @@ -69,6 +74,8 @@ string querySetting(const string & name, const string & def); bool queryBoolSetting(const string & name, bool def); +unsigned int queryIntSetting(const string & name, unsigned int def); + } -- cgit 1.4.1