On Friday March 15, 2002 10:18 pm, Tavis Rudd wrote:
> Hello again,
> there as appears to a buglet in SessionMemoryStore that might leave
> old session files lying around permanently if TaskKit or Application
> change in subtle ways in the future:
>
>       def __init__(self, app, restoreFiles=1):
>               SessionStore.__init__(self, app)
>               self._store = {}
>               if restoreFiles == 1:
>                       filestore = SessionFileStore(app)
>                       keys = filestore.keys()
>                       for i in keys:
>                               self[i] = filestore[i]
>
>       def storeAllSessions(self):
>               filestore = SessionFileStore(self._app)
>               for i in self.keys():
>                       filestore[i]=self[i]
>
> In theory, there there should be a:
>    filestore.clear()
> added after the old sessions are restored because the 'filestore'
> appears to be discarded after it is used in __init__.

You're right.  I'll add it.

> In practice, I assume TaskKit keeps a reference to it and the old
> sessions are cleared by the sweeper thread. But, it wouldn't hurt to
> be safe.

No, I don't think TaskKit will ever clean it up.  The sweeper thread will 
only sweep the old sessions from memory, but I don't think they'll ever get 
deleted from disk, because FileStore is temporarily used while loading and 
saving the sessions but isn't used while sweeping the sessions.  

This bug only affects SessionMemoryStore, not Dynamic or File stores.

- Geoff

_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to