Change in vdsm[master]: utils: Add unhandled exceptions logging decorator

danken at redhat.com danken at redhat.com
Fri Nov 29 13:10:33 UTC 2013


Dan Kenigsberg has submitted this change and it was merged.

Change subject: utils: Add unhandled exceptions logging decorator
......................................................................


utils: Add unhandled exceptions logging decorator

We have at least two places where exceptions in thread main function are
not handled, making debugging such threads impossible. This patch adds a
new decorator that make it easy to log tracebacks for unhandled
exceptions.

The recommended use case is to decorate a thread main function. This
ensure that we get a traceback for any error in the thread, including
errors in error handling code. This should be used on all in threads in
the system.

Note that the decorator only adds logging - it does not change the
program flow.  The unhandled exception is raise again so you can safely
use it on script main function, without changing the exit code. Do not
try to use this for ignoring exceptions.

See utilsTests for example usage.

Change-Id: I39265bac4f26fefa365bad080dafb6106145f846
Relates-To: https://bugzilla.redhat.com/1034741
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/21778
Reviewed-by: Sergey Gotliv <sgotliv at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M lib/vdsm/utils.py
M tests/utilsTests.py
2 files changed, 82 insertions(+), 0 deletions(-)

Approvals:
  Nir Soffer: Verified
  Sergey Gotliv: Looks good to me, but someone else must approve
  Dan Kenigsberg: Looks good to me, approved



-- 
To view, visit http://gerrit.ovirt.org/21778
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I39265bac4f26fefa365bad080dafb6106145f846
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgotliv at redhat.com>
Gerrit-Reviewer: Vered Volansky <vvolansk at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list