{"action":"created","comment":{"url":"https://api.github.com/repos/OptimalBits/bull/pulls/comments/87879182","pull_request_review_id":8472456,"id":87879182,"diff_hunk":"@@ -615,17 +637,14 @@ Queue.prototype.processJob = function(job){\n   //\n   var renew = false;\n   var lockRenewer = function(){\n-    // The first call to lock the job should ensure that the job is in the 'active' state,\n-    // because it might have gotten picked up already by another processor. We don't need\n-    // to do this on subsequent calls.\n-    return job.takeLock(_this.token, renew, !renew).then(function(locked){\n-      if(locked){\n+    return job.takeLock(renew, true).then(function(lock){","path":"lib/queue.js","position":250,"original_position":250,"commit_id":"5c1e9d9b5e8e480050b558c197e37a48210b924c","original_commit_id":"5c1e9d9b5e8e480050b558c197e37a48210b924c","user":{"login":"doublerebel","id":212827,"avatar_url":"https://avatars.githubusercontent.com/u/212827?v=3","gravatar_id":"","url":"https://api.github.com/users/doublerebel","html_url":"https://github.com/doublerebel","followers_url":"https://api.github.com/users/doublerebel/followers","following_url":"https://api.github.com/users/doublerebel/following{/other_user}","gists_url":"https://api.github.com/users/doublerebel/gists{/gist_id}","starred_url":"https://api.github.com/users/doublerebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doublerebel/subscriptions","organizations_url":"https://api.github.com/users/doublerebel/orgs","repos_url":"https://api.github.com/users/doublerebel/repos","events_url":"https://api.github.com/users/doublerebel/events{/privacy}","received_events_url":"https://api.github.com/users/doublerebel/received_events","type":"User","site_admin":false},"body":"Here [`takeLock` returns early](https://github.com/nextorigin/bull/blob/5c1e9d9b5e8e480050b558c197e37a48210b924c/lib/scripts.js#L327) and relies on redlock to extend the lock, `ensureActive` is only considered for new locks.  So I don't know if insinuating the second parameter matters on a renew is necessary?\r\n","created_at":"2016-11-14T19:52:43Z","updated_at":"2016-11-14T19:52:43Z","html_url":"https://github.com/OptimalBits/bull/pull/379#discussion_r87879182","pull_request_url":"https://api.github.com/repos/OptimalBits/bull/pulls/379","_links":{"self":{"href":"https://api.github.com/repos/OptimalBits/bull/pulls/comments/87879182"},"html":{"href":"https://github.com/OptimalBits/bull/pull/379#discussion_r87879182"},"pull_request":{"href":"https://api.github.com/repos/OptimalBits/bull/pulls/379"}}},"pull_request":{"url":"https://api.github.com/repos/OptimalBits/bull/pulls/379","id":93503509,"html_url":"https://github.com/OptimalBits/bull/pull/379","diff_url":"https://github.com/OptimalBits/bull/pull/379.diff","patch_url":"https://github.com/OptimalBits/bull/pull/379.patch","issue_url":"https://api.github.com/repos/OptimalBits/bull/issues/379","number":379,"state":"open","locked":false,"title":"ioredis; atomic locking with redlock; support Node 6.x [Fixes #185, Fixes #370]","user":{"login":"doublerebel","id":212827,"avatar_url":"https://avatars.githubusercontent.com/u/212827?v=3","gravatar_id":"","url":"https://api.github.com/users/doublerebel","html_url":"https://github.com/doublerebel","followers_url":"https://api.github.com/users/doublerebel/followers","following_url":"https://api.github.com/users/doublerebel/following{/other_user}","gists_url":"https://api.github.com/users/doublerebel/gists{/gist_id}","starred_url":"https://api.github.com/users/doublerebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doublerebel/subscriptions","organizations_url":"https://api.github.com/users/doublerebel/orgs","repos_url":"https://api.github.com/users/doublerebel/repos","events_url":"https://api.github.com/users/doublerebel/events{/privacy}","received_events_url":"https://api.github.com/users/doublerebel/received_events","type":"User","site_admin":false},"body":"Hello,\r\n\r\nThis PR changes the redis dependency from **node_redis** to **ioredis**, fixing #185 (and completing PR #188).  **ioredis** uses promises \"all-the-way-down\", exposing errors in the test suite.  These tests are fixed and passing, including the race condition described in #370.\r\n\r\nThere are several commits here, to demonstrate the bugs and fixes made to the test suite.  I am happy to squash this down, but right now each commit contains a description of the issues solved with the updated tests.\r\n\r\nAs part of solving #370, [**node-redlock**](https://github.com/mike-marcacci/node-redlock) is now used to implement atomic locking with a guaranteed owner.  **node-redlock** is a promise-based lib which keeps track of its own secret token/value for each job/resource, which makes node-redlock valuable whether or not it's used with redis clustering.\r\n\r\nThanks for your work, looking forward to your feedback.","created_at":"2016-11-14T03:32:23Z","updated_at":"2016-11-14T19:52:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06260d0df717b46a960ab8d3f6e16266d93ff077","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OptimalBits/bull/pulls/379/commits","review_comments_url":"https://api.github.com/repos/OptimalBits/bull/pulls/379/comments","review_comment_url":"https://api.github.com/repos/OptimalBits/bull/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OptimalBits/bull/issues/379/comments","statuses_url":"https://api.github.com/repos/OptimalBits/bull/statuses/5c1e9d9b5e8e480050b558c197e37a48210b924c","head":{"label":"nextorigin:issue-185","ref":"issue-185","sha":"5c1e9d9b5e8e480050b558c197e37a48210b924c","user":{"login":"nextorigin","id":6021231,"avatar_url":"https://avatars.githubusercontent.com/u/6021231?v=3","gravatar_id":"","url":"https://api.github.com/users/nextorigin","html_url":"https://github.com/nextorigin","followers_url":"https://api.github.com/users/nextorigin/followers","following_url":"https://api.github.com/users/nextorigin/following{/other_user}","gists_url":"https://api.github.com/users/nextorigin/gists{/gist_id}","starred_url":"https://api.github.com/users/nextorigin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextorigin/subscriptions","organizations_url":"https://api.github.com/users/nextorigin/orgs","repos_url":"https://api.github.com/users/nextorigin/repos","events_url":"https://api.github.com/users/nextorigin/events{/privacy}","received_events_url":"https://api.github.com/users/nextorigin/received_events","type":"Organization","site_admin":false},"repo":{"id":73508272,"name":"bull","full_name":"nextorigin/bull","owner":{"login":"nextorigin","id":6021231,"avatar_url":"https://avatars.githubusercontent.com/u/6021231?v=3","gravatar_id":"","url":"https://api.github.com/users/nextorigin","html_url":"https://github.com/nextorigin","followers_url":"https://api.github.com/users/nextorigin/followers","following_url":"https://api.github.com/users/nextorigin/following{/other_user}","gists_url":"https://api.github.com/users/nextorigin/gists{/gist_id}","starred_url":"https://api.github.com/users/nextorigin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nextorigin/subscriptions","organizations_url":"https://api.github.com/users/nextorigin/orgs","repos_url":"https://api.github.com/users/nextorigin/repos","events_url":"https://api.github.com/users/nextorigin/events{/privacy}","received_events_url":"https://api.github.com/users/nextorigin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nextorigin/bull","description":"A NodeJS persistent job and message queue based on Redis","fork":true,"url":"https://api.github.com/repos/nextorigin/bull","forks_url":"https://api.github.com/repos/nextorigin/bull/forks","keys_url":"https://api.github.com/repos/nextorigin/bull/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nextorigin/bull/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nextorigin/bull/teams","hooks_url":"https://api.github.com/repos/nextorigin/bull/hooks","issue_events_url":"https://api.github.com/repos/nextorigin/bull/issues/events{/number}","events_url":"https://api.github.com/repos/nextorigin/bull/events","assignees_url":"https://api.github.com/repos/nextorigin/bull/assignees{/user}","branches_url":"https://api.github.com/repos/nextorigin/bull/branches{/branch}","tags_url":"https://api.github.com/repos/nextorigin/bull/tags","blobs_url":"https://api.github.com/repos/nextorigin/bull/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nextorigin/bull/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nextorigin/bull/git/refs{/sha}","trees_url":"https://api.github.com/repos/nextorigin/bull/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nextorigin/bull/statuses/{sha}","languages_url":"https://api.github.com/repos/nextorigin/bull/languages","stargazers_url":"https://api.github.com/repos/nextorigin/bull/stargazers","contributors_url":"https://api.github.com/repos/nextorigin/bull/contributors","subscribers_url":"https://api.github.com/repos/nextorigin/bull/subscribers","subscription_url":"https://api.github.com/repos/nextorigin/bull/subscription","commits_url":"https://api.github.com/repos/nextorigin/bull/commits{/sha}","git_commits_url":"https://api.github.com/repos/nextorigin/bull/git/commits{/sha}","comments_url":"https://api.github.com/repos/nextorigin/bull/comments{/number}","issue_comment_url":"https://api.github.com/repos/nextorigin/bull/issues/comments{/number}","contents_url":"https://api.github.com/repos/nextorigin/bull/contents/{+path}","compare_url":"https://api.github.com/repos/nextorigin/bull/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nextorigin/bull/merges","archive_url":"https://api.github.com/repos/nextorigin/bull/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nextorigin/bull/downloads","issues_url":"https://api.github.com/repos/nextorigin/bull/issues{/number}","pulls_url":"https://api.github.com/repos/nextorigin/bull/pulls{/number}","milestones_url":"https://api.github.com/repos/nextorigin/bull/milestones{/number}","notifications_url":"https://api.github.com/repos/nextorigin/bull/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nextorigin/bull/labels{/name}","releases_url":"https://api.github.com/repos/nextorigin/bull/releases{/id}","deployments_url":"https://api.github.com/repos/nextorigin/bull/deployments","created_at":"2016-11-11T20:13:52Z","updated_at":"2016-11-11T20:13:53Z","pushed_at":"2016-11-14T19:06:33Z","git_url":"git://github.com/nextorigin/bull.git","ssh_url":"git@github.com:nextorigin/bull.git","clone_url":"https://github.com/nextorigin/bull.git","svn_url":"https://github.com/nextorigin/bull","homepage":"","size":940,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"OptimalBits:master","ref":"master","sha":"7a891205d3810dac90b0c46fe975ab6bef78b528","user":{"login":"OptimalBits","id":945399,"avatar_url":"https://avatars.githubusercontent.com/u/945399?v=3","gravatar_id":"","url":"https://api.github.com/users/OptimalBits","html_url":"https://github.com/OptimalBits","followers_url":"https://api.github.com/users/OptimalBits/followers","following_url":"https://api.github.com/users/OptimalBits/following{/other_user}","gists_url":"https://api.github.com/users/OptimalBits/gists{/gist_id}","starred_url":"https://api.github.com/users/OptimalBits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OptimalBits/subscriptions","organizations_url":"https://api.github.com/users/OptimalBits/orgs","repos_url":"https://api.github.com/users/OptimalBits/repos","events_url":"https://api.github.com/users/OptimalBits/events{/privacy}","received_events_url":"https://api.github.com/users/OptimalBits/received_events","type":"Organization","site_admin":false},"repo":{"id":10999165,"name":"bull","full_name":"OptimalBits/bull","owner":{"login":"OptimalBits","id":945399,"avatar_url":"https://avatars.githubusercontent.com/u/945399?v=3","gravatar_id":"","url":"https://api.github.com/users/OptimalBits","html_url":"https://github.com/OptimalBits","followers_url":"https://api.github.com/users/OptimalBits/followers","following_url":"https://api.github.com/users/OptimalBits/following{/other_user}","gists_url":"https://api.github.com/users/OptimalBits/gists{/gist_id}","starred_url":"https://api.github.com/users/OptimalBits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OptimalBits/subscriptions","organizations_url":"https://api.github.com/users/OptimalBits/orgs","repos_url":"https://api.github.com/users/OptimalBits/repos","events_url":"https://api.github.com/users/OptimalBits/events{/privacy}","received_events_url":"https://api.github.com/users/OptimalBits/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OptimalBits/bull","description":"A NodeJS persistent job and message queue based on Redis","fork":false,"url":"https://api.github.com/repos/OptimalBits/bull","forks_url":"https://api.github.com/repos/OptimalBits/bull/forks","keys_url":"https://api.github.com/repos/OptimalBits/bull/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OptimalBits/bull/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OptimalBits/bull/teams","hooks_url":"https://api.github.com/repos/OptimalBits/bull/hooks","issue_events_url":"https://api.github.com/repos/OptimalBits/bull/issues/events{/number}","events_url":"https://api.github.com/repos/OptimalBits/bull/events","assignees_url":"https://api.github.com/repos/OptimalBits/bull/assignees{/user}","branches_url":"https://api.github.com/repos/OptimalBits/bull/branches{/branch}","tags_url":"https://api.github.com/repos/OptimalBits/bull/tags","blobs_url":"https://api.github.com/repos/OptimalBits/bull/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OptimalBits/bull/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OptimalBits/bull/git/refs{/sha}","trees_url":"https://api.github.com/repos/OptimalBits/bull/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OptimalBits/bull/statuses/{sha}","languages_url":"https://api.github.com/repos/OptimalBits/bull/languages","stargazers_url":"https://api.github.com/repos/OptimalBits/bull/stargazers","contributors_url":"https://api.github.com/repos/OptimalBits/bull/contributors","subscribers_url":"https://api.github.com/repos/OptimalBits/bull/subscribers","subscription_url":"https://api.github.com/repos/OptimalBits/bull/subscription","commits_url":"https://api.github.com/repos/OptimalBits/bull/commits{/sha}","git_commits_url":"https://api.github.com/repos/OptimalBits/bull/git/commits{/sha}","comments_url":"https://api.github.com/repos/OptimalBits/bull/comments{/number}","issue_comment_url":"https://api.github.com/repos/OptimalBits/bull/issues/comments{/number}","contents_url":"https://api.github.com/repos/OptimalBits/bull/contents/{+path}","compare_url":"https://api.github.com/repos/OptimalBits/bull/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OptimalBits/bull/merges","archive_url":"https://api.github.com/repos/OptimalBits/bull/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OptimalBits/bull/downloads","issues_url":"https://api.github.com/repos/OptimalBits/bull/issues{/number}","pulls_url":"https://api.github.com/repos/OptimalBits/bull/pulls{/number}","milestones_url":"https://api.github.com/repos/OptimalBits/bull/milestones{/number}","notifications_url":"https://api.github.com/repos/OptimalBits/bull/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OptimalBits/bull/labels{/name}","releases_url":"https://api.github.com/repos/OptimalBits/bull/releases{/id}","deployments_url":"https://api.github.com/repos/OptimalBits/bull/deployments","created_at":"2013-06-27T14:35:35Z","updated_at":"2016-11-14T16:10:29Z","pushed_at":"2016-11-14T19:06:34Z","git_url":"git://github.com/OptimalBits/bull.git","ssh_url":"git@github.com:OptimalBits/bull.git","clone_url":"https://github.com/OptimalBits/bull.git","svn_url":"https://github.com/OptimalBits/bull","homepage":"","size":994,"stargazers_count":1187,"watchers_count":1187,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":134,"mirror_url":null,"open_issues_count":90,"forks":134,"open_issues":90,"watchers":1187,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OptimalBits/bull/pulls/379"},"html":{"href":"https://github.com/OptimalBits/bull/pull/379"},"issue":{"href":"https://api.github.com/repos/OptimalBits/bull/issues/379"},"comments":{"href":"https://api.github.com/repos/OptimalBits/bull/issues/379/comments"},"review_comments":{"href":"https://api.github.com/repos/OptimalBits/bull/pulls/379/comments"},"review_comment":{"href":"https://api.github.com/repos/OptimalBits/bull/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OptimalBits/bull/pulls/379/commits"},"statuses":{"href":"https://api.github.com/repos/OptimalBits/bull/statuses/5c1e9d9b5e8e480050b558c197e37a48210b924c"}}}}
{"actor":{"display_login":"doublerebel"}}