Re: How to monitor long-running fork in Skunkweb?

Drew Csillag <[email protected]>
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
I'm thinking that whether concurrency is a problem or not is
dependant on the session store used.  It would seem that if you use a
database backed session store, all is ok, the database handles the
concurrency.  

If you use the FSSessionStore, it's probably ok as long as the file
writes are done a particular way.  I believe it's done correctly but
haven't checked -- write to tempfile and rename, like the caching
file writes are done such that you never see a half written file --
if it's not done that way, it *should* be.  

The only concurrency issues I can see with the session system in
general is if you have multiple writers -- last one wins.  If you are
going to have multiple writers, you can still mitigate the problem
(though not remove it entirely) by doing your session changes
quickly, i.e. refresh session data from the store (is there a method
for this?), update [I'm thinking sess.update(changedict)], save; with
no intervening delay.  Yes, you could still lose, but unless you are
updating very frequently, the chances are minimal.  

If there was a method made [say, sess.atomic_update(changedict)], it
could be a hook to the underlying session store to lock the
underlying session resource while it does the refresh-update-save
bit, in which case there shouldn't be any lossage.  You could still
have a bit of lossage, *if* the multiple writers were updating the
same *keys* in the session dict, but if that's an issue, *no*
repository will probably help you with that.

But single writer, mulitple readers should always be ok right now, as
the session data should *always* be consistent.  Actually, of ACID, I
think we have A, C and if on a journalled FS, D.  Hey Jacob, not too
shabby!  How's about we add a SQL interface?  <duck>

OTOH, I may be totally missing the whole point of the question, and
be blabbering about incoherently....

Drew

P.S.  Jacob, stop beating up the sessions!!!  Yes, they have a couple
of corners and *theoretical* scalability problems, but in practice
they really work well.


	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.