From: Mark Wooding Date: Fri, 11 May 2018 23:45:14 +0000 (+0100) Subject: svc/connect.in: Add a backstop exception handler to the pinger loop. X-Git-Tag: 1.5.0~87 X-Git-Url: https://git.distorted.org.uk/~mdw/tripe/commitdiff_plain/ebe4877136ed90fdad60ce7e4cdd4bed1369cee4?hp=8ad21c29ca841c084d04db928f1015e95b0f2623 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. --- 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): """