[mod_python] Session.py: filesession_cleanup (I)

David Janes davidjanes at blogmatrix.com
Fri Nov 9 08:53:56 EST 2007

I'm getting random hangs on a mod_python based system under moderately load.
I haven't tracked down the problem yet, but based on some error logging I've
been doing code inspection and have a few comments/questions.

In Session.py, function filesession_cleanup, lines 624-638 there's a
try/except block that returns on an exception. However, to get to this
block, 'lockfp' has to be open -- and there is no close in the exception

Should not this code block be moved inside the next try/finally block which
ensures the file object is closed?

In my logs I am getting the error message

python_cleanup: Error calling cleanup object <function filesession_cleanup
at 0xb7b22924>
exceptions.TypeError: not enough arguments for format string

The likely culprit for this error is line 705 (-707):

            req.log_error("FileSession cleanup incomplete: next cleanup will
start at index %d (%02x)"
                        % (next_i,),

Does this make sense?

Regards, etc...

David Janes
Founder, BlogMatrix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20071109/64dcad5d/attachment.html

More information about the Mod_python mailing list