Welcome Guest, Not a member yet? Register   Sign In
Session: Error while trying to free lock for ci_session
#41

(05-26-2016, 11:09 AM)spjonez Wrote: This makes the error disappear but is probably not the way to solve it:

Code:
    protected function _release_lock()
    {
        if (isset($this->_redis, $this->_lock_key) && $this->_lock)
        {
            if ( ! $this->_redis->delete($this->_lock_key) && $this->_redis->exists($this->_lock_key))
            {
                log_message('error', 'Session: Error while trying to free lock for '.$this->_lock_key);
                return FALSE;
            }

            $this->_lock_key = NULL;
            $this->_lock = FALSE;
        }

        return TRUE;
    }

Yea, not logging the error in the first place is better than an exists() call ... but neither is ideal, I want to know for sure when and why delete() would return 0 fist.

(05-26-2016, 11:09 AM)spjonez Wrote: I posed this as an issue on phpredis's Github page to see if I can get clarification on deleting keys set to expire: https://github.com/phpredis/phpredis/issues/816

Great, I've subscribed to the issue. But ... as somebody who deals with bug reports on a daily basis, I can tell you that's far from a good one. Here's why:

- "delete() returns 0 while deleting 1 key" is all you know for sure.
- The possibility of it returning 0 specifically for keys set to expire is ... a noteworthy detail, but your wording choice makes it rather a speculation.
- I can assure you, the phpredis maintainer(s) don't give a crap how you managed to encounter the behavior, linking to or even mentioning CodeIgniter is an unnecessary distraction.
- Linking to this thread (or a post in it) may be helpful to gain context, but using third-party resources to provide what should've been in the issue description is a major annoyance. I sometimes receive bug reports linking to StackOverflow questions "for the details" and I am infuriated when that happens - it's a lazy thing to do, not helping others to help you while asking them to do so.
- FFS, stop calling it "3.06", it's 3.0.6 and I've told you that previously ... how can you do that distinction for phpredis with 2.2.7 and then mess it up for CI in the very same sentence?

That last one is for me really, but yea ... when doing bug reports - leave out speculation and irrelevant details, focus on the substance.
Reply


Messages In This Thread
RE: Session: Error while trying to free lock for ci_session - by Narf - 05-26-2016, 11:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB