Handle all exceptions in log-pusher.py.

* modules/openstack_project/files/logstash/log-pusher.py: Catch and
log all exceptions that make it to the top of our poll loops. Allows
for greater debugging of the script.

Change-Id: I4f8bb2ea1629ee98f5e70c978a299c889a22a939
Reviewed-on: https://review.openstack.org/27876
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2013-04-30 18:08:30 -07:00 committed by Jenkins
parent 9863c147dc
commit ea8542377f

View File

@ -84,7 +84,10 @@ class LogRetriever(threading.Thread):
def run(self):
while True:
self._handle_event()
try:
self._handle_event()
except:
logging.exception("Exception retrieving log event.")
def _handle_event(self):
event = self.eventq.get()
@ -252,7 +255,11 @@ def main():
retriever.daemon = True
retriever.start()
while True:
processor.handle_log_event()
try:
processor.handle_log_event()
except:
logging.exception("Exception processing log event.")
raise
if __name__ == '__main__':