[Catalyst] Session handling under heavy usage

Yuval Kogman nothingmuch at woobling.org
Wed Mar 22 20:25:56 CET 2006


On Wed, Mar 22, 2006 at 12:22:20 -0700, Rusty Conover wrote:
> 
> On Mar 22, 2006, at 11:58 AM, Edric wrote:
> 
> >"May infrequently drop, erase, or corrupt your session data at seemingly
> >random, and impossible to predict intervals."
> >
> >that is exactly what happens to me :-(
> >
> 
> 
> The use of Hash::Merge might be helpful, but again you're going to have to find a contention algorithm that works for you app.  Last write wins might not always work.
> 
> You could also track the signature of the session when its loaded from the store,  versus the signature of the one currently in the store when you attempt to write, then merging the data if the 
> session has changed before write.  Of course the store needs to respect locking while this operation is occurring.

That means conflict resolution has to happen.

The two plugins I plan on writing (eventually) are one for
exclusive lock lock-on-first-write (that is, when you try to modify
some key somewhere in side, using tie magic, or whatever, it will
lock the hash till it's written), and the other is atomic
write-with-merge at the end of the request


-- 
 ()  Yuval Kogman <nothingmuch at woobling.org> 0xEBD27418  perl hacker &
 /\  kung foo master: /me wields bonsai kittens: neeyah!!!!!!!!!!!!!!!!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060322/81ef0d4b/attachment.pgp 


More information about the Catalyst mailing list