Message97504
I am running an in house application that uses multiprocessing logger.
This application ftp's files from a remote host and keep them on a local
disk. Here is the scenario -
While pulling the files, I make the local disk full (100%). The application hangs, it can not log further. Apart from other exceptions, following are prominent ones. If I further create cleanup the disk, the application does not proceed. It
remains hung. I have to restart the application.
File "/export/home/yateen/ess/3rdparty/python/solaris/lib/python2.6/logging/__init__.py", line 1059, in error
self._log(ERROR, msg, args, **kwargs)
File "/export/home/yateen/ess/3rdparty/python/solaris/lib/python2.6/logging/__init__.py", line 1141, in _log
self.handle(record)
File "/export/home/yateen/ess/3rdparty/python/solaris/lib/python2.6/logging/__init__.py", line 1151, in handle
self.callHandlers(record)
File "/export/home/yateen/ess/3rdparty/python/solaris/lib/python2.6/logging/__init__.py", line 1188, in callHandlers
hdlr.handle(record)
File "/export/home/yateen/ess/3rdparty/python/solaris/lib/python2.6/logging/__init__.py", line 671, in handle
self.release()
File "build/bdist.solaris-2.10-sun4u/egg/cloghandler.py", line 189, in release
self.stream.flush()
I tried looking into the logging module's code and could not find IOError exception handling there. After going through
various situations, and trial-errors (I am not a python Guru), I found following fix working -
method handle(record), file logging/__init__.py, line#670
original code -
rv = self.filter(record)
if rv:
self.acquire()
try:
self.emit(record)
finally:
self.release()
return rv
Modified code -
rv = self.filter(record)
if rv:
self.acquire()
try:
self.emit(record)
finally:
try:
self.release()
except (IOError, OSError):
pass
return rv
What this tells is if there is an error in locks handling, simply leave it and proceed. With this fix, when the disk is
cleaned up, application proceeds properly.
What I want to know if this is an appropriate fix? Can I go ahead with it?
Thanks,
Yateen.. |
|
Date |
User |
Action |
Args |
2010-01-10 10:58:32 | yateenjoshi | set | recipients:
+ yateenjoshi |
2010-01-10 10:58:31 | yateenjoshi | set | messageid: <1263121111.41.0.440295567357.issue7664@psf.upfronthosting.co.za> |
2010-01-10 10:58:29 | yateenjoshi | link | issue7664 messages |
2010-01-10 10:58:26 | yateenjoshi | create | |
|