From 5813f6d12519f4b056b1f5c7b7eefdfaa598858a Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Mon, 22 Jun 2015 09:46:54 -0400 Subject: [PATCH] Make unhandled exceptions not fatal This commit removes a raise in the server class when it encounters an unhandled exception. Previously the exception would be logged and then it would raise it again, which would be fatal to the process. We encountered a DB connection issue a few weeks ago which shouldn't be fatal to the worker (just that one event/db connection) but this crashed the worker process. So this attempts to remedy this from happening in the future by not making this sort of failure fatal to the whole process. Maybe this isn't a good idea, but since the first time we encountered an unhandled exception being raised in the server class it brought down the worker for ~22 days. So the thought is instead of crashing just logging the failure and moving on is a better idea. However, if there is really a fatal exception being raised this means the process will never crash and just log it on each event. Change-Id: I4019831e24144205508f7918dab5c8fce6cfc74a --- files/subunit-gearman-worker.py | 1 - 1 file changed, 1 deletion(-) diff --git a/files/subunit-gearman-worker.py b/files/subunit-gearman-worker.py index dd1d125..ce2c8f2 100644 --- a/files/subunit-gearman-worker.py +++ b/files/subunit-gearman-worker.py @@ -239,7 +239,6 @@ class Server(object): self.processor.handle_subunit_event() except: logging.exception("Exception processing log event.") - raise def main():