6.0.0-git
2019-03-23

[#2913] memcached session locking
Summary memcached session locking
Queue Horde Framework Packages
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Owners Horde Developers (at)
Requester adrieder (at) sbox (dot) tugraz (dot) at
Created 2005-11-03 (4888 days ago)
Due
Updated 2007-02-22 (4412 days ago)
Assigned 2005-11-03 (4888 days ago)
Resolved 2005-12-02 (4859 days ago)
Milestone
Patch No

History
2007-02-22 16:35:22 Jan Schneider Comment #10 Reply to this comment
Wouldn't it make more sense to store a lock key in the memcache server 
instead of relying on a shared file system for locking?
2005-12-06 16:25:12 adrieder (at) sbox (dot) tugraz (dot) at Comment #9 Reply to this comment
There is still a bug in the driver:



the function _unlockSession() should not take a parameter at line 233


2005-12-05 19:58:33 Chuck Hagenbuch Deleted Original Message
 
2005-12-05 16:09:18 kevin_myer (at) iu13 (dot) org Comment #8 Reply to this comment
I'd propose a slightly different fix - if you call _unlockSession
without an $id, it's doing nothing.

I think this patch would be desired behaviour - remove the flock,
then remove the file itself.
Argh, except, close() isn't setup to take $id as an argument, so that 
call to _unlockSession fails..  I missed the introduction of the $_fp 
resource.  In which case, the original patch is more or less correct.


2005-12-05 15:56:47 kevin_myer (at) iu13 (dot) org Comment #7
New Attachment: memcached.php[2].patch
Reply to this comment
Cool. I've cleaned it up and committed it to HEAD and FRAMEWORK_3. Thanks!
I noticed that you cleanups introduced a small bug.
The close() function doesn't have an argument. I attached a patch
which should deal with this problem,
I'd propose a slightly different fix - if you call _unlockSession 
without an $id, it's doing nothing.



I think this patch would be desired behaviour - remove the flock, then 
remove the file itself.


2005-12-02 20:57:10 adrieder (at) sbox (dot) tugraz (dot) at Comment #6
New Attachment: memcached.php[1].patch Download
Reply to this comment
Cool. I've cleaned it up and committed it to HEAD and FRAMEWORK_3. Thanks!
I noticed that you cleanups introduced a small bug.

The close() function doesn't have an argument. I attached a patch 
which should deal with this problem,


2005-12-02 18:03:38 Chuck Hagenbuch Comment #5
State ⇒ Resolved
Reply to this comment
Cool. I've cleaned it up and committed it to HEAD and FRAMEWORK_3. Thanks!
2005-12-02 15:26:14 adrieder (at) sbox (dot) tugraz (dot) at Comment #4 Reply to this comment
Is this patch stable/in use? I'm not clear exactly which versions the
people having trouble with memcached are using.
We use it since I posted it. 4 servers 10000 users. It works, which 
means we do not see the "message not found" problem anymore.

One thing is which I had do do additionally: Clean the tmp dir from 
stale session locks from time to time. Cronjob: find /tmp/lock_* \( 
-type f -amin +120 \) -exec rm -f {} \;
2005-12-02 05:09:10 Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
Is this patch stable/in use? I'm not clear exactly which versions the 
people having trouble with memcached are using.
2005-11-03 20:15:56 Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
2005-11-03 20:01:19 adrieder (at) sbox (dot) tugraz (dot) at Comment #2 Reply to this comment
Forgot to mention:

The idea and solution is based on  Gary Windham's <windhamg@email.arizona.edu>

memcached_flock driver. He kindly provided the code.
2005-11-03 19:04:22 adrieder (at) sbox (dot) tugraz (dot) at Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ memcached session locking
Queue ⇒ Horde Framework Packages
New Attachment: memcached.php.patch Download
Reply to this comment
The attached patch helps to get around the "requested message not 
found" issue, which is due to no serialization of concurrent session 
access.


Saved Queries