Message130362
This is my first report, apologies if I missed any tracker etiquette.
The logging module registers shutdown() to run via atexit. shutdown() calls flush() and close() on each handler.
However if a FileHandler is writing to a file while shutdown() is executing, an IOError will be raised as the file is being closed while written to. (This can happen if you use daemon threads, which can still be running while exiting.)
Traceback (most recent call last):
File "/usr/local/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
func(*targs, **kargs)
File "/usr/local/lib/python2.7/logging/__init__.py", line 1616, in shutdown
h.close()
File "/usr/local/lib/python2.7/logging/__init__.py", line 898, in close
self.stream.close()
IOError: close() called during concurrent operation on the same file object.
I'm not familiar with the internals of logging, but it seems that FileHandler should call self.acquire()/self.release() around its close and flush operations. Otherwise a daemon thread might be emitting a record while closing the handler. |
|
Date |
User |
Action |
Args |
2011-03-08 19:54:34 | Adam.Ernst | set | recipients:
+ Adam.Ernst |
2011-03-08 19:54:34 | Adam.Ernst | set | messageid: <1299614074.11.0.136259749977.issue11444@psf.upfronthosting.co.za> |
2011-03-08 19:54:33 | Adam.Ernst | link | issue11444 messages |
2011-03-08 19:54:33 | Adam.Ernst | create | |
|