durusmail: quixote-users: SCGI and session bug.
SCGI and session bug.
quixote - zodb session example, was session bug
2003-07-18
2003-07-17
2003-07-25
SCGI and session bug.
Van der Merwe HJ <13361562@sun.ac.za>
2003-07-17
Hello,

I have developed my website with SCGI. There is a problem with it
though, if two requests come through almost at once, SCGI forks and
creates a new QuixoteHandler, which in turn creates a new
SessionPublisher, which in turn creates a new SessionManager. Since
this SessionManager is new, it knows nothing of the existing sessions,
and has the result of returning HTTP error code 400, and logging out
the user (likely with a "session expired" page, though I have not
checked, in my case it usually "bombs out" trying to download an
image).

I believe this to be a serious bug in the SCGI+SessionManagement. I
either need a fix for this, or some recommendations as to what else to
use. What does everyone here do? How does mod_python handle the
situation, I suspect that if two requests arrive in rapid succession,
apache will only hand one at a time to python?

Thoughts about mod_python: I use my own session class derived from
quixote.session.Session. mod_python_handler.py, however, does not
provide for any easy way to override/derive a modified version, so I
have to create my own modified copy that code in order to use
mod_python?

I also find that mod_python "clears the session manager" after a
certain time. (Idle time, or total running time?) - I will be
downloading mod_python documentation as this email is sent, I'm sure
there's info on how that works.

I do prefer scgi though, if it weren't for this bug, I can then have
the scgi app running as any user I like.

My apologies if this has been discussed, I am not at home,
and do not have access to cheap internet or to my mail archive.
(I'm still developing though, I like quixote so much ;)

Thanks,
Hugo van der Merwe


reply