{"action":"closed","issue":{"url":"https://api.github.com/repos/phpredis/phpredis/issues/816","repository_url":"https://api.github.com/repos/phpredis/phpredis","labels_url":"https://api.github.com/repos/phpredis/phpredis/issues/816/labels{/name}","comments_url":"https://api.github.com/repos/phpredis/phpredis/issues/816/comments","events_url":"https://api.github.com/repos/phpredis/phpredis/issues/816/events","html_url":"https://github.com/phpredis/phpredis/issues/816","id":157046301,"number":816,"title":"Delete returns 0 for a key that exists","user":{"login":"monsterlane","id":3654199,"avatar_url":"https://avatars.githubusercontent.com/u/3654199?v=3","gravatar_id":"","url":"https://api.github.com/users/monsterlane","html_url":"https://github.com/monsterlane","followers_url":"https://api.github.com/users/monsterlane/followers","following_url":"https://api.github.com/users/monsterlane/following{/other_user}","gists_url":"https://api.github.com/users/monsterlane/gists{/gist_id}","starred_url":"https://api.github.com/users/monsterlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monsterlane/subscriptions","organizations_url":"https://api.github.com/users/monsterlane/orgs","repos_url":"https://api.github.com/users/monsterlane/repos","events_url":"https://api.github.com/users/monsterlane/events{/privacy}","received_events_url":"https://api.github.com/users/monsterlane/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-26T18:17:46Z","updated_at":"2016-06-07T17:07:22Z","closed_at":"2016-06-07T17:07:22Z","body":"Seeing some really odd results using this extension with CodeIgniter's Redis session library. When close is called I get an error that it cannot free the lock. I'm using the latest release of this extension (2.2.7) and CI (3.0.6) on PHP 5.6.\r\n\r\nHere's a link to the library's code: https://github.com/bcit-ci/CodeIgniter/blob/develop/system/libraries/Session/drivers/Session_redis_driver.php\r\n\r\nHere's a modified code exert so you can see exactly where the error appears: \r\n\r\n```\r\n\tprotected function _release_lock($code = 0)\r\n\t{\r\n\t\tif (isset($this->_redis, $this->_lock_key) && $this->_lock)\r\n\t\t{\r\n\t\t\t$exists = $this->_redis->exists($this->_lock_key);\r\n\t\t\t$del = $this->_redis->delete($this->_lock_key);\r\n\r\n\t\t\tif ( !$del)\r\n\t\t\t{\r\n\t\t\t\t$exists2 = $this->_redis->exists($this->_lock_key);\r\n\r\n\t\t\t\tlog_message('error', 'Session: Error while trying to free lock for '.$this->_lock_key . ', code=' . $code . ', del=' . var_export($del,true) . ', exists=' . var_export($exists,true) . ', exists2=' . var_export($exists2,true));\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\r\n\t\t\t$this->_lock_key = NULL;\r\n\t\t\t$this->_lock = FALSE;\r\n\t\t}\r\n\r\n\t\treturn TRUE;\r\n\t}\r\n```\r\n\r\nThe error I get is:\r\n\r\nSession: Error while trying to free lock for ci_session:guid:lock, code=2, del=0, exists=true, exists2=false\r\n\r\nIs this expected since the key is set to expire? Why does exists return true but delete returns 0 immediately after? The second exists2 returns false as expected.\r\n\r\nIf this is expected, what is the proper way to delete the key so it returns a non 0 response?"}}
{"actor":{"display_login":"monsterlane"}}