orchestrator: improve SIGINT logging/output

parent b4c46fbf
......@@ -44,11 +44,15 @@ def main():
if i % 10000 == 0:
logging.info('Received {:d} answers'.format(i))
txn.put(qkey, blob)
except KeyboardInterrupt as err:
logging.info('SIGINT received, exiting...')
sys.exit(130)
except RuntimeError as err:
logging.error(err)
sys.exit(1)
finally:
# attempt to preserve data if something went wrong (or not)
logging.debug('Comitting LMDB transaction...')
txn.commit()
meta.write_end_time()
......
......@@ -11,6 +11,7 @@ threads or processes. Make sure not to break this compatibility.
from argparse import Namespace
import random
import signal
import selectors
import socket
import ssl
......@@ -76,6 +77,7 @@ def module_init(args: Namespace) -> None:
def worker_init() -> None:
__worker_state.timeouts = {}
signal.signal(signal.SIGINT, signal.SIG_IGN)
worker_reinit()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment