6.0.0-beta1
7/15/25

[#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 11/03/2005 (7194 days ago)
Due
Updated 02/22/2007 (6718 days ago)
Assigned 11/03/2005 (7194 days ago)
Resolved 12/02/2005 (7165 days ago)
Milestone
Patch No

History
02/22/2007 04:35:22 PM 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?
12/06/2005 04:25:12 PM 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


12/05/2005 07:58:33 PM Chuck Hagenbuch Deleted Original Message
 
12/05/2005 04:09:18 PM 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.


12/05/2005 03:56:47 PM 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.


12/02/2005 08:57:10 PM 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,


12/02/2005 06:03:38 PM 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!
12/02/2005 03:26:14 PM 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 {} \;
12/02/2005 05:09:10 AM 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.
11/03/2005 08:15:56 PM Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
11/03/2005 08:01:19 PM 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.
11/03/2005 07:04:22 PM adrieder (at) sbox (dot) tugraz (dot) at Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ memcached session locking
Queue ⇒ Horde Framework Packages
New Attachment: memcached.php.patch Download
State ⇒ New
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