[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
75/376: nix-store --serve: Monitor for client disconnects
From: |
Ludovic Courtès |
Subject: |
75/376: nix-store --serve: Monitor for client disconnects |
Date: |
Wed, 28 Jan 2015 22:04:08 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit 78224cd871e7ce9af628836995620abcb70e6935
Author: Eelco Dolstra <address@hidden>
Date: Wed Jul 23 19:26:34 2014 +0200
nix-store --serve: Monitor for client disconnects
This is necessary because build-remote.pl now builds via ‘nix-store
--serve’. So if a build hangs without writing to stdout/stderr, and
the client disconnects, then we need to detect that.
---
src/nix-store/nix-store.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 048f5c6..25a955e 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -8,6 +8,7 @@
#include "util.hh"
#include "serve-protocol.hh"
#include "worker-protocol.hh"
+#include "monitor-fd.hh"
#include <iostream>
#include <algorithm>
@@ -879,6 +880,8 @@ static void opServe(Strings opFlags, Strings opArgs)
FdSource in(STDIN_FILENO);
FdSink out(STDOUT_FILENO);
+ MonitorFdHup monitor(in.fd);
+
/* Exchange the greeting. */
unsigned int magic = readInt(in);
if (magic != SERVE_MAGIC_1) throw Error("protocol mismatch");
- 63/376: Get rid of a compiler warning, (continued)
- 63/376: Get rid of a compiler warning, Ludovic Courtès, 2015/01/28
- 43/376: Remove tabs, Ludovic Courtès, 2015/01/28
- 64/376: nix-daemon: Fix compat with older clients, Ludovic Courtès, 2015/01/28
- 57/376: Manual: Typo, Ludovic Courtès, 2015/01/28
- 53/376: build-remote.pl: Fix build log, Ludovic Courtès, 2015/01/28
- 61/376: Handle case collisions on case-insensitive systems, Ludovic Courtès, 2015/01/28
- 66/376: nix-daemon: Show name of connecting user, Ludovic Courtès, 2015/01/28
- 59/376: Install systemd and Upstart stuff only on Linux, Ludovic Courtès, 2015/01/28
- 60/376: Make dev-shell script work on Darwin, Ludovic Courtès, 2015/01/28
- 68/376: Ugly hack to fix building on old Darwin, Ludovic Courtès, 2015/01/28
- 75/376: nix-store --serve: Monitor for client disconnects,
Ludovic Courtès <=
- 70/376: Better fix for strcasecmp on Darwin, Ludovic Courtès, 2015/01/28
- 73/376: startProcess: Make writing error messages from the child more robust, Ludovic Courtès, 2015/01/28
- 67/376: nix-daemon: Add trusted-users and allowed-users options, Ludovic Courtès, 2015/01/28
- 56/376: Remove cruft, Ludovic Courtès, 2015/01/28
- 76/376: nix-daemon: Simplify stderr handling, Ludovic Courtès, 2015/01/28
- 71/376: Revert old useBuildHook behaviour, Ludovic Courtès, 2015/01/28
- 65/376: nix-daemon: Only print connection info if we have SO_PEERCRED, Ludovic Courtès, 2015/01/28
- 69/376: Bump, Ludovic Courtès, 2015/01/28
- 62/376: Be more strict about file names in NARs, Ludovic Courtès, 2015/01/28
- 78/376: Pass -pthread only for programs that need it, Ludovic Courtès, 2015/01/28