[horde] memcache session tracking

Andrew Morgan morgan at orst.edu
Tue Oct 14 18:20:05 UTC 2008


On Tue, 14 Oct 2008, Michael M Slusarz wrote:

> Quoting Andrew Morgan <morgan at orst.edu>:
>
>> Should I merge the change in v1.24 of SessionHandler/memcache.php as well?
>
> It would not hurt.  The main differences is that we do explicitly do garbage 
> collection right before we provide a list of Session IDs, and we completely 
> honor the 'track_lifetime' param which speeds things up considerably.  This 
> second change does mean that if a user is still logged in after 
> 'track_lifetime', their session will no longer be counted although this has 
> nothing to do with their actual session data (since it is updated every time 
> the session is written).
>
> Looking at this code, it is safe to merge back to FW_3, which I will do 
> shortly.
>
>> I was looking at the following code in SessionHandler/memcache.php:
>>
>>    function _trackGC()
>>    {
>>        $this->_memcache->lock($this->_trackID);
>>        $ids = $this->_memcache->get($this->_trackID);
>>        if (empty($ids)) {
>>            return;
>>        }
>> 
>> Shouldn't it call unlock in the "if (empty($ids))" block?  If the tracking 
>> array is empty (but exists), then a lock will be held on it unnecessarily.
>
> You are right - I have fixed this.

Thanks, I have all of these changes in place on my test site now.

 	Andy


More information about the horde mailing list