I'd like to take a stab at some enhancements to the WebKit CGI wrapper
to improve reliability, as has been discussed before on this list.
Here's what I propose, in pseudo-Python:
appserver_address = None
if '_SID_' cookie exists:
session_id = contents of _SID_ cookie
appserver_address = contents of the 'SessionServers/' +
if not appserver_address:
if 'SessionServers/DEFAULT' was written less than APPSERVER_LIFETIME
appserver_address = contents of 'SessionServers/DEFAULT'
connect to the running appserver at appserver_address. (If we
read the address
from 'SessionServers/DEFAULT', and that file was
written out recently,
it means the app server may still be starting, so
retry for a certain length of time until the appserver
a chance to start.)
erase the file we read the appserver address from
if not already connected:
Look through all SessionServers/* files and pick an address that is
already in use
write out the address into 'SessionServers/DEFAULT'
start up appserver (using os.fork on Unix or os.spawnve on Windows),
with a special environment variable set that indicates
supposed to run as described below.
<now proceed as normal in WebKit.cgi>
The AppServer would also be modified so that if the special environment
is set, it runs as follows:
- The AppServer starts up listening to the address in
- The AppServer writes out its address into 'SessionServers/' +
whenever it creates a session cookie
- When a session expires, delete the 'SessionServers/' + session_id
- When all sessions have expired, if the address it's listening to is
longer the same address as in 'SessionServers/DEFAULT', it exits.
How does this sound? Chuck, does this match what you were thinking of?
I'll take suggestions for a couple of days, then based on the feedback
I'll go ahead and implement whatever is decided upon. I'm thinking this
should be a separate file from WebKit.cgi -- any suggestions for a
- Geoff Talvola