[bind10-dev] Generic approach to #3003

Mukund Sivaraman muks at isc.org
Mon Aug 19 02:12:08 UTC 2013


Hi Michal

On Tue, Aug 06, 2013 at 05:34:47PM +0200, Michal 'vorner' Vaner wrote:
> Hello
> 
> If I look at #3003, it tries to solve really corner-case situation. IMO we don't
> need to solve each kind of broken installation separately and letting the lower
> layer to throw exception is appropriate (same as when a .so is installed for
> different architecture or .py file is missing).
> 
> However, I do agree that producing traceback is not nice. So I think, instead of
> fixing one really rare situation, we should fix the tracebacks. I don't know if
> there's a way in python to register handler for unhandled exceptions, but even
> if there wasn't, we can provide a catch-all on the top level of each program.
> 
> So, my proposal is to catch all the unhandled exceptions at the top level and
> instead of letting python to print the traceback to stderr, log a FATAL message
> with the message and store the exception traceback to some file (and print the
> filename in the message too).
> 
> Something like:
> 
> def main():
>   try:
>     real_main()
>   except Exception as e:
>     filename = write_traceback_to_file(e)
>     logger.FATAL(UNHANDLED_EXCEPTION, e)
> 
> I think this solution:
>  • Is no harder to implement
>  • Is more generic, solves more problems
>  • Saves the tracebacks for us to have something to debug
> 
> What do you think about it?

The proposal to catch exceptions and handle them nicely sounds good to
me.

On writing traceback to a file, where would this file be stored? There
are things to consider such as what to do with old files, permissions,
multiple components, etc.

Our log output already includes multi-line messages (and sometimes
contains exception traces already), so can't we just log the traceback?

		Mukund
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20130819/38e0365e/attachment.bin>


More information about the bind10-dev mailing list