Ben Parker wrote:
Hi, I have a bug and fix to submit. Attached is a patch file for WebKit/SessionStore.py against the 0.9 release.

The SessionStore convenience functions items() and values() include a bug where a session key can be deleted after self.keys() has been called, but before the session has been accessed from the store. This leads to an unhandled KeyError which causes SessionSweeper to fail, allowing sessions to pile up until catastrophic failure due to lack of memory.

When using the SessionMemoryStore, this bug is extraordinarily rare. I only encountered it with a high-traffic site where we use SessionDynamicStore, and every Monday (the site's highest traffic day) the appserver would consume all memory ending up with about 75,000 sessions, and I would find traces of this error in the logs (way back in the logs). After applying the fix a few weeks ago, the app has been fine ever since.

I have checked this in as suggested, adding a similar fix for get().

For a completely foolproof solution, maybe items(), values() and get() should be overridden in SessionDynamicStore, and wrapped in a lock?

-- Christoph


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to