1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 04:21:16 +02:00

* While waiting for a lock, print a sign of life every 5 minutes.

This prevents remote builders from being killed by the
  `max-silent-time' inactivity monitor while they are waiting for a
  long garbage collection to finish.  This happens fairly often in the
  Hydra build farm.
This commit is contained in:
Eelco Dolstra 2010-02-03 21:22:57 +00:00
parent c45de33c67
commit f859a8d3c3
3 changed files with 27 additions and 3 deletions

View file

@ -31,6 +31,11 @@ static void sigintHandler(int signo)
}
static void sigalrmHandler(int signo)
{
}
Path makeRootName(const Path & gcRoot, int & counter)
{
counter++;
@ -160,6 +165,14 @@ static void initAndRun(int argc, char * * argv)
if (sigaction(SIGPIPE, &act, 0))
throw SysError("ignoring SIGPIPE");
/* Catch SIGALRM with an empty handler (we just need it to get an
EINTR from blocking system calls). */
act.sa_handler = sigalrmHandler;
sigfillset(&act.sa_mask);
act.sa_flags = 0;
if (sigaction(SIGALRM, &act, 0))
throw SysError("installing handler for SIGALRM");
/* Reset SIGCHLD to its default. */
act.sa_handler = SIG_DFL;
act.sa_flags = 0;