perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Ochs <snackt...@gmail.com>
Subject Re: apache:session and mod perl
Date Thu, 30 Dec 2004 21:15:53 GMT
> So you have a lost update problem.  There is probably a way to structure
> things to avoid this (maybe not using sessions for it), but some form of
> mutually exclusive locking would fix it, at the expense of making your
> site slower, since each frame will have to wait for its turn.  You might
> try to make your code avoid loading sessions in frames where they are not
> absolutely needed.

I have found three things that need to be worked around like this in
order to use this approach.  One is frames like you said, the other is
not pulling in stylesheets via an href, and the other is making sure
images are not loaded through mod perl.   If I do all of that I don't
have any problems.  I still don't like it, but it might be our only
option.


> The thing that makes the difference here is really the locking module.
> Take a look at the code inside Apache::Session::Postgres.  It uses the
> Null locking module because Postgres is supposed to handle the locking.
> You could have it use the locking from the file-based or MySQL-based
> sessions if you wanted to.  Apache::Session::Flex makes this easy to
> specify.

I tried setting Lock to File instead of Null, but there is some sort
of contention issue because after the first request all other requests
hang like they are waiting for a lock to be release.  I did preload
Apache::Session:Lock::File.

Also, I found out through further testing that Apache::Session doesn't
do exclusive locking on read, only write.  Which is what I would
expect actually after thinking about it for a minute.  And that also
means that there isn't any need for additional locking with postgresql
because using SELECT FOR UPDATE basically does the same thing as the
file locking.

> You're allowing dirty reads?  That's not the normal isolation level for
> Postgres.  That is likely the source of your problems.  Can you change
> that to the default level, or is there something else that will break?
> 

No, my mistake I was using the wrong terminology.  I use the default
isolation in postgresql.

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html


Mime
View raw message