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__.
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.
Tavis
On Friday 15 March 2002 18:30, Tavis Rudd wrote:
> Hi,
> I just noticed what looks like a thread conflict in the cvs version
> of SessionDynamicStore.py at 158, storeAllSessions. It acquires
> the lock and then calls MoveToFile, which will wait until it can
> acquire the lock:
>
> def MovetoFile(self, key):
> self._lock.acquire()
> try:
> global debug
> if debug: print ">> Moving %s to File" % key
> self._fileStore[key] = self._memoryStore[key]
> del self._memoryStore[key]
> finally:
> self._lock.release()
>
>
>
> ## Application support ##
>
> def storeSession(self, session):
> pass
>
> def storeAllSessions(self):
> self._lock.acquire()
> try:
> for i in self._memoryStore.keys():
> self.MovetoFile(i)
> finally:
> self._lock.release()
> Tavis
>
> _______________________________________________
> Webware-discuss mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss