Closed MichaelRawson closed 6 months ago
To explain the signal-handling change: currently we handle many different signals with very similar but slightly different code. This looks more like organic growth over time rather than something intentionally complex, so I've streamlined it. There are now only two broad classes of signal we handle:
SIGHUP
(portfolio parent died), SIGINT
(Ctrl-C), SIGTERM
(polite termination), and SIGXCPU
(we're being warned that we've used an external resource limit and are about to be killed). SIGXCPU
has moved from the other class, I don't think we want to special-case this.SIGQUIT
as apparently that's an abnormal halt intended to be used for debugging. Here we print a stack trace, indicate something to Spider, etc.Since you already polished the signals, could you please give me back the feature we used to have, that Vampire reports statistics (if asked) and termination reason on CTRL+C?
(This should be obvious in vampire mode, not sure how complex it is in portfolio mode? Does the CTRL+C reach the master if there are many competing workers spawned from it?)
See #462. We currently synchronise child Vampires and their proof printing by UNIX semaphores, which are quite complex beasts. However, C11 (and therefore C++17) can synchronise on a file by passing an "x"clusive flag to
fopen
: if the file exists,fopen
will fail. Note that the standard only says "to the extent the platform supports exclusive access", but it seems to work quite well in practice.Therefore:
I think this is simpler and certainly more portable, but of course it needs lots of testing: it would be a silly way to lose problems.