On Sun, Mar 04 2018, Ludovic Courtès wrote: > Good catch. We could add this in gnu-build-system.scm in > core-updates, though it’s no big deal anyway since these are > throw-away environments. > > Thoughts? The current forking-service.sh test fails in that environment, so we won't be able to build shepherd on Hurd, or systems with Linux pre 3.4. This is already the case without my third commit, though, because the prctl fallback logic isn't in place yet. I think we should add it in core-updates. It does affect the behaviour of processes within the build environment, and can lead to test failures if people rely on pid 1 to reap zombie processes (which, from what I understand, they should be able to). This could even be leading to test failures in other packages which we have just disabled. >> + (match (select (list sock) (list) (list) 0.5) >> + (((sock) _ _) >> + (read-from sock)) >> + (_ >> + #f)) >> + (poll-services) > > Here everyone ends up paying some overhead (the 0.5 second > timeout), > which isn’t great. > > How about something like: > > (define poll-services > (and (not (= 1 (getpid))) > …)) > > (match (select (list sock) '() '() (if poll-services 0.5 0)) > …) The wait for 0.5 seconds is only an upper-bound for the timeout. Changing it to a 0 would actually be worse, because it would spend longer polling for running services. The `select` procedure waits for `sock` to be ready to read from. When it's ready it returns immediately, but if `sock` takes more than 0.5 seconds to be ready then it will return anyway (and take the second branch in the match, which does nothing). This should incur no (or extremely minuscule) overhead in how long it takes to respond to a socket, but provides an opportunity every half a second (at most) for shepherd to poll the running services. On reflection, we should also change the commit message for this commit. I have attached a patch with a more accurate commit message. Carlo