From ebe4877136ed90fdad60ce7e4cdd4bed1369cee4 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 12 May 2018 00:45:14 +0100 Subject: [PATCH] svc/connect.in: Add a backstop exception handler to the pinger loop. It'll moan, but it won't actually kill the loop any more. --- svc/connect.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/svc/connect.in b/svc/connect.in index c68e520d..37714252 100644 --- a/svc/connect.in +++ b/svc/connect.in @@ -37,6 +37,7 @@ from math import sqrt import cdb as CDB import mLib as M import re as RX +import sys as SYS from time import time import subprocess as PROC @@ -567,7 +568,9 @@ class Pinger (T.Coroutine): while True: (peer, seq), code, stuff = me._q.get() if peer in me._peers and seq == me._peers[peer].seq: - me._peers[peer].event(code, stuff) + try: me._peers[peer].event(code, stuff) + except Exception, e: + SYS.excepthook(*SYS.exc_info()) def add(me, peer, pingnow): """ -- 2.11.0