BIND 10 #267: python log shouldn't die with OSError
BIND 10 Development
do-not-reply at isc.org
Fri Jul 9 01:33:57 UTC 2010
#267: python log shouldn't die with OSError
---------------------+------------------------------------------------------
Reporter: jinmei | Owner: jinmei
Type: defect | Status: reviewing
Priority: major | Milestone: 06. 4th Incremental Release
Component: logging | Resolution:
Keywords: | Sensitive: 0
---------------------+------------------------------------------------------
Comment(by jinmei):
Replying to [comment:2 zzchen_pku]:
> I think this patch should be ok.
> Jinmei, can you review it?
First off, add tests please:-)
Comments on the patch:
- I'm not sure why the second chunk of patch performs various tests
(e.g., whether the file is writable). if we need them here, shouldn't we
need them in other places including the constructor? Also,
update_config() itself doesn't seem to perform system level operations, so
I'm not sure if we need to create the directory here.
- for that matter, I'm not even sure if we need to bother to create the
directory beforehand. It may or may not be a good thing, but since it's
an extension to python's library behavior, I'd like to see documentation
about which policy is adopted and why. Then that policy should be applied
consistently throughout this module (see the first bullet about
consistency)
- not necessarily about the patch, but relevant to the issue of this
ticket: NSFileLogHandler.shouldRollover() can also call os.makedirs(), and
it can raise an exception, right? What should we do with this?
- since the underlying logging facility can raise an exception, I'm not
sure if it makese sense to try catching exceptions one by one. We should
probably catch exceptions in a wider context, e.g., on initialization and
in NSLogger.log_message(), and perhaps when updating the configuration.
--
Ticket URL: <https://bind10.isc.org/ticket/267#comment:3>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list