Hi Geoffrey,

Thanks for the clear analysis of the likely issues and the
suggestions.  My results are below.

On Sunday, March 31, 2002, at 7:36:09 PM, Geoffrey Talvola wrote:

GT> You're using the dynamic session store, right? Then the session
GT> gets pickled from memory to disk after 15 minutes of inactivity
GT> (by default; this is configurable using the
GT> 'DynamicSessionTimeout' setting). Then if someone accesses the
GT> session after between 15 and 60 minutes of inactivity, it will
GT> have to fetch the session back from disk into memory. That seems
GT> to be failing for some reason.

That makes a lot of sense.

GT> Do you get errors on startup if you stop and restart the
GT> appserver?

No.  It seems to start up fine.  However, if I try to use the same
browser to access the site after restarting the appserver, I get the
same problem.

I have found a way to repeat the error 100 percent of the time.  I
have a login page; I log in, then I restart the appserver.  Then I
reload the page.  100 percent of the time I get the error.
Furthermore, when stopping the appserver, I get the following error:

Shutdown Called Mon Apr  1 00:11:08 2002
ThreadedAppServer: Shutting Down
Shutting down the AppServer
Application is Shutting Down
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/local/lib/python2.2/threading.py", line 408, in __bootstrap
    self.run()
  File "/usr/local/lib/python2.2/threading.py", line 396, in run
    apply(self.__target, self.__args, self.__kwargs)
  File "./WebKit/AppServer.py", line 86, in closeThread
    self.shutDown()
  File "./WebKit/ThreadedAppServer.py", line 318, in shutDown
    AppServer.shutDown(self)
  File "./WebKit/AppServer.py", line 119, in shutDown
    self._app.shutDown()
  File "./WebKit/Application.py", line 236, in shutDown
    self._sessions.storeAllSessions()
  File "./WebKit/SessionDynamicStore.py", line 161, in storeAllSessions
    self.MovetoFile(i)
  File "./WebKit/SessionDynamicStore.py", line 145, in MovetoFile
    self._fileStore[key] = self._memoryStore[key]
  File "./WebKit/SessionFileStore.py", line 77, in __setitem__
    self.encoder()(item, file)
UnpickleableError: Cannot pickle <type 'weakref'> objects

This also happens 100 percent of the time -- this exact error.

GT> That would indicate some type of pickling problem that doesn't
GT> show up with you are writing the session to disk, but shows up
GT> when you are _unpickling_ the session. Also, try switching
GT> temporarily to the File store. If there is a pickling problem,
GT> that should flush it out quickly.

You're right, I was using dynamic session store.  When I switch to
File, I get the following error /every time/:

Traceback (most recent call last):
  File "./WebKit/Application.py", line 388, in dispatchRequest
    self.handleGoodURL(transaction)
  File "./WebKit/Application.py", line 537, in handleGoodURL
    self.sleep(transaction)
  File "./WebKit/Application.py", line 718, in sleep
    self._sessions.storeSession(transaction.session())
  File "./WebKit/SessionFileStore.py", line 112, in storeSession
    self[key] = session
  File "./WebKit/SessionFileStore.py", line 77, in __setitem__
    self.encoder()(item, file)
UnpickleableError: Cannot pickle <type 'weakref'> objects



GT> Another idea: go into SessionFileStore.py and remove the try/except around 
GT> line 55.  That was added recently in an attempt to handle pickling errors 
GT> more gracefully, but in this case it may be obscuring the real problem.

When I do this, the code looks like:

     51 #           try:
     52             item = self.decoder()(file)
     53 #           except:
     54                 # Corrupt data; pretend it doesn't exist
     55 #               raise KeyError, key

Then when I use the method described above to reproduce the error
(using the dynamic store again), I get a different error:

Traceback (most recent call last):
  File "./WebKit/Application.py", line 368, in dispatchRequest
    elif self.isSessionIdProblematic(request):
  File "./WebKit/Application.py", line 466, in isSessionIdProblematic
    if (time()-request.session().lastAccessTime()) >= request.session().timeout():
  File "./WebKit/HTTPRequest.py", line 225, in session
    return self._transaction.session()
  File "./WebKit/Transaction.py", line 67, in session
    self._session = self._application.createSessionForTransaction(self)
  File "./WebKit/Application.py", line 889, in createSessionForTransaction
    session = self.session(sessId)
  File "./WebKit/Application.py", line 725, in session
    return self._sessions[sessionId]
  File "./WebKit/SessionDynamicStore.py", line 72, in __getitem__
    self.MovetoMemory(key)
  File "./WebKit/SessionDynamicStore.py", line 135, in MovetoMemory
    self._memoryStore[key] = self._fileStore[key]
  File "WebKit/SessionFileStore.py", line 52, in __getitem__
    item = self.decoder()(file)
EOFError

Apparently the global except masked the EOFError above......

I think we're very close!  Is there anything else I can do to assist?

-------------------------------------------------------------- 
Steven D. Arnold                                    Neosynapse
[EMAIL PROTECTED]                        Managing Partner
AIM: abraxan                       MSN: [EMAIL PROTECTED]



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

Reply via email to