[bind10-dev] Generic approach to #3003

Michal 'vorner' Vaner michal.vaner at nic.cz
Tue Aug 6 15:34:47 UTC 2013


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?

With regards

-- 
The problem with graduate students, in general, is that they have
to sleep every few days.

Michal 'vorner' Vaner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.isc.org/pipermail/bind10-dev/attachments/20130806/53063ef2/attachment.bin>


More information about the bind10-dev mailing list