Catch gear.InterruptedError

This is how gear lets us know that it has been stopped by another
thread.  Since we weren't catching these exceptions explicitly,
they were polluting the logs on shutdown (especially in tests).
Catch them and return immediately from the daemon run methods.

Change-Id: I6f845566c759651e630d7f93c94dce975ad53d30
This commit is contained in:
James E. Blair
2017-03-02 12:00:52 -08:00
parent 149b69c288
commit 39a4a9f48c
2 changed files with 4 additions and 0 deletions

View File

@@ -100,6 +100,8 @@ class MergeServer(object):
except Exception:
self.log.exception("Exception while running job")
job.sendWorkException(traceback.format_exc())
except gear.InterruptedError:
return
except Exception:
self.log.exception("Exception while getting job")