{"action":"created","issue":{"url":"https://api.github.com/repos/etcinit/speedbump/issues/7","repository_url":"https://api.github.com/repos/etcinit/speedbump","labels_url":"https://api.github.com/repos/etcinit/speedbump/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/etcinit/speedbump/issues/7/comments","events_url":"https://api.github.com/repos/etcinit/speedbump/issues/7/events","html_url":"https://github.com/etcinit/speedbump/pull/7","id":165670627,"number":7,"title":"fix race condition for key expiry. remove unneeded EXISTS calls.","user":{"login":"soroushjp","id":1213121,"avatar_url":"https://avatars.githubusercontent.com/u/1213121?v=3","gravatar_id":"","url":"https://api.github.com/users/soroushjp","html_url":"https://github.com/soroushjp","followers_url":"https://api.github.com/users/soroushjp/followers","following_url":"https://api.github.com/users/soroushjp/following{/other_user}","gists_url":"https://api.github.com/users/soroushjp/gists{/gist_id}","starred_url":"https://api.github.com/users/soroushjp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soroushjp/subscriptions","organizations_url":"https://api.github.com/users/soroushjp/orgs","repos_url":"https://api.github.com/users/soroushjp/repos","events_url":"https://api.github.com/users/soroushjp/events{/privacy}","received_events_url":"https://api.github.com/users/soroushjp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-14T22:12:10Z","updated_at":"2016-07-26T22:51:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/etcinit/speedbump/pulls/7","html_url":"https://github.com/etcinit/speedbump/pull/7","diff_url":"https://github.com/etcinit/speedbump/pull/7.diff","patch_url":"https://github.com/etcinit/speedbump/pull/7.patch"},"body":"This commit makes two changes, based by the advice in the [Redis docs](http://redis.io/commands/INCR#pattern-rate-limiter-1).\r\n\r\nThe first is the use of a single set of logic to increment and expire a key in Redis regardless of whether the key previously exists or not. This avoids a race condition where `INCR` is called on a key without also calling `EXPIRE`, in the case where the key is expired by Redis between:\r\n\r\n1. checking for its existence\r\n2. calling `INCR` on the key.\r\n\r\nSeparately, this commit moves from using an `EXIST` and a `GET` call to only making a `GET` call where possible, since `GET` already returns an explicit \"nil\" error when key does not exist.\r\n\r\nSome minor additions to comments."},"comment":{"url":"https://api.github.com/repos/etcinit/speedbump/issues/comments/235430291","html_url":"https://github.com/etcinit/speedbump/pull/7#issuecomment-235430291","issue_url":"https://api.github.com/repos/etcinit/speedbump/issues/7","id":235430291,"user":{"login":"soroushjp","id":1213121,"avatar_url":"https://avatars.githubusercontent.com/u/1213121?v=3","gravatar_id":"","url":"https://api.github.com/users/soroushjp","html_url":"https://github.com/soroushjp","followers_url":"https://api.github.com/users/soroushjp/followers","following_url":"https://api.github.com/users/soroushjp/following{/other_user}","gists_url":"https://api.github.com/users/soroushjp/gists{/gist_id}","starred_url":"https://api.github.com/users/soroushjp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soroushjp/subscriptions","organizations_url":"https://api.github.com/users/soroushjp/orgs","repos_url":"https://api.github.com/users/soroushjp/repos","events_url":"https://api.github.com/users/soroushjp/events{/privacy}","received_events_url":"https://api.github.com/users/soroushjp/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T22:51:28Z","updated_at":"2016-07-26T22:51:28Z","body":"Hi @etcinit, have you had a chance to take a look at this? Happy to provide any extra information about the race condition or other minor changes if that is helpful."}}
{"actor":{"display_login":"soroushjp"}}