#55 SessionFileStore raises KeyError on corrupt session data

closed-fixed
nobody
WebKit (58)
5
2008-11-08
2003-08-26
Ben Parker
No

In SessionFileStore.__getitem__(), the store raises a
KeyError on corrupted session data, and leaves the
corrupted data on the filesystem.

If corrupted data is written during a bad appserver
shutdown, the SessionStore continually throws those
KeyErrors for any attempt to iterate over active sessions.

The SessionFileStore should at least raise a different
type of error indicating the problem is not KeyError but
corrupted data. But then shouldn't it clean up the
session? or maybe move it to a "corrupted" directory for
review?

Discussion

  • This is similar to #678129 and has been fixed in r1758. The corrupt file is now removed and the error message is reported via app.handleException(). However, we still raise a KeyError, so that the application behaves like when the session is expired and does not break with unexpected errors. (Should have been closed already 5 years ago ;-)

     
    • status: open --> closed-fixed