From: Stefan Metzmacher Date: Fri, 13 Mar 2020 06:06:05 +0000 (+0100) Subject: selftest: make sure dns_hub.py exits on SIGINT X-Git-Tag: ldb-2.2.0~1186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d1d67ed725348b7a6bf8ea9f0a7554a198c1363;p=thirdparty%2Fsamba.git selftest: make sure dns_hub.py exits on SIGINT Otherwise we have a deadlock in the python threading that prevents out EOF detection on stdin to work if someone aborts 'make test' with strg+c. Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/selftest/target/dns_hub.py b/selftest/target/dns_hub.py index dcf59dcd701..6b3c0f07087 100755 --- a/selftest/target/dns_hub.py +++ b/selftest/target/dns_hub.py @@ -37,6 +37,11 @@ else: DNS_REQUEST_TIMEOUT = 10 +# make sure the script dies immediately when hitting control-C, +# rather than raising KeyboardInterrupt. As we do all database +# operations using transactions, this is safe. +import signal +signal.signal(signal.SIGINT, signal.SIG_DFL) class DnsHandler(sserver.BaseRequestHandler): dns_qtype_strings = dict((v, k) for k, v in vars(dns).items() if k.startswith('DNS_QTYPE_'))