Commit 88752c93 authored by juga's avatar juga
Browse files

scanner: log any exception raised by main_loop

before stopping the scanner.
parent 14b8ccf7
......@@ -36,6 +36,9 @@ pool = None
rd = None
controller = None
FILLUP_TICKET_MSG = """Something went wrong.
Please create a ticket in with this traceback."""
def stop_threads(signal, frame, exit_code=0):
global rd, pool
......@@ -540,14 +543,18 @@ def run_speedtest(args, conf):
max_pending_results = conf.getint('scanner', 'measurement_threads')
pool = Pool(max_pending_results)
main_loop(args, conf, controller, rl, cb, rd, rp, destinations,
max_pending_results, pool)
except KeyboardInterrupt:"Interrupted by the user.")
stop_threads(signal.SIGINT, None)
# Any exception not catched at this point would make the scanner stall.
# Log it and exit gracefully.
except Exception as e:
stop_threads(signal.SIGTERM, None, 1)
def gen_parser(sub):
Supports Markdown
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