{"action":"created","comment":{"url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/comments/42685463","id":42685463,"diff_hunk":"@@ -0,0 +1,20 @@\n+module LockerHelper\n+  mattr_accessor :block_time\n+  self.block_time = 0\n+\n+  def self.delay_after_unlock(time, &block)\n+    self.block_time = time\n+    block.call\n+    self.block_time = 0\n+  end\n+","path":"spec/support/locker.rb","position":null,"original_position":10,"commit_id":"90f264767ddafed2095cbfb6bc9739bcc0d70cec","original_commit_id":"c2448fdf199b2dd29bb8275ced1690d20d256ba1","user":{"login":"iures","id":171380,"avatar_url":"https://avatars.githubusercontent.com/u/171380?v=3","gravatar_id":"","url":"https://api.github.com/users/iures","html_url":"https://github.com/iures","followers_url":"https://api.github.com/users/iures/followers","following_url":"https://api.github.com/users/iures/following{/other_user}","gists_url":"https://api.github.com/users/iures/gists{/gist_id}","starred_url":"https://api.github.com/users/iures/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iures/subscriptions","organizations_url":"https://api.github.com/users/iures/orgs","repos_url":"https://api.github.com/users/iures/repos","events_url":"https://api.github.com/users/iures/events{/privacy}","received_events_url":"https://api.github.com/users/iures/received_events","type":"User","site_admin":false},"body":"white line","created_at":"2015-10-21T21:33:28Z","updated_at":"2015-10-21T21:33:28Z","html_url":"https://github.com/promiscuous-io/promiscuous_black_hole/pull/11#discussion_r42685463","pull_request_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/comments/42685463"},"html":{"href":"https://github.com/promiscuous-io/promiscuous_black_hole/pull/11#discussion_r42685463"},"pull_request":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/11","id":48376995,"html_url":"https://github.com/promiscuous-io/promiscuous_black_hole/pull/11","diff_url":"https://github.com/promiscuous-io/promiscuous_black_hole/pull/11.diff","patch_url":"https://github.com/promiscuous-io/promiscuous_black_hole/pull/11.patch","issue_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues/11","number":11,"state":"open","locked":false,"title":"Lock around transactions to protect against contention","user":{"login":"benseligman","id":1707408,"avatar_url":"https://avatars.githubusercontent.com/u/1707408?v=3","gravatar_id":"","url":"https://api.github.com/users/benseligman","html_url":"https://github.com/benseligman","followers_url":"https://api.github.com/users/benseligman/followers","following_url":"https://api.github.com/users/benseligman/following{/other_user}","gists_url":"https://api.github.com/users/benseligman/gists{/gist_id}","starred_url":"https://api.github.com/users/benseligman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benseligman/subscriptions","organizations_url":"https://api.github.com/users/benseligman/orgs","repos_url":"https://api.github.com/users/benseligman/repos","events_url":"https://api.github.com/users/benseligman/events{/privacy}","received_events_url":"https://api.github.com/users/benseligman/received_events","type":"User","site_admin":false},"body":"When a schema is updated, we need to lock the table around the whole transaction. The old code released the lock before the transaction committed, which meant that the lock didn't wrap all of the dangerous code. This change pushes responsibility for locking up to the operation class, which can wrap all of the important work in the lock.","created_at":"2015-10-21T19:34:35Z","updated_at":"2015-10-21T21:33:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a04b8673967f25eb42212ccb76f864715b45cd3a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/11/commits","review_comments_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/11/comments","review_comment_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/comments{/number}","comments_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues/11/comments","statuses_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/statuses/90f264767ddafed2095cbfb6bc9739bcc0d70cec","head":{"label":"promiscuous-io:bs-reduce-contention","ref":"bs-reduce-contention","sha":"90f264767ddafed2095cbfb6bc9739bcc0d70cec","user":{"login":"promiscuous-io","id":5614417,"avatar_url":"https://avatars.githubusercontent.com/u/5614417?v=3","gravatar_id":"","url":"https://api.github.com/users/promiscuous-io","html_url":"https://github.com/promiscuous-io","followers_url":"https://api.github.com/users/promiscuous-io/followers","following_url":"https://api.github.com/users/promiscuous-io/following{/other_user}","gists_url":"https://api.github.com/users/promiscuous-io/gists{/gist_id}","starred_url":"https://api.github.com/users/promiscuous-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/promiscuous-io/subscriptions","organizations_url":"https://api.github.com/users/promiscuous-io/orgs","repos_url":"https://api.github.com/users/promiscuous-io/repos","events_url":"https://api.github.com/users/promiscuous-io/events{/privacy}","received_events_url":"https://api.github.com/users/promiscuous-io/received_events","type":"Organization","site_admin":false},"repo":{"id":36684774,"name":"promiscuous_black_hole","full_name":"promiscuous-io/promiscuous_black_hole","owner":{"login":"promiscuous-io","id":5614417,"avatar_url":"https://avatars.githubusercontent.com/u/5614417?v=3","gravatar_id":"","url":"https://api.github.com/users/promiscuous-io","html_url":"https://github.com/promiscuous-io","followers_url":"https://api.github.com/users/promiscuous-io/followers","following_url":"https://api.github.com/users/promiscuous-io/following{/other_user}","gists_url":"https://api.github.com/users/promiscuous-io/gists{/gist_id}","starred_url":"https://api.github.com/users/promiscuous-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/promiscuous-io/subscriptions","organizations_url":"https://api.github.com/users/promiscuous-io/orgs","repos_url":"https://api.github.com/users/promiscuous-io/repos","events_url":"https://api.github.com/users/promiscuous-io/events{/privacy}","received_events_url":"https://api.github.com/users/promiscuous-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/promiscuous-io/promiscuous_black_hole","description":"","fork":false,"url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole","forks_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/forks","keys_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/teams","hooks_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/hooks","issue_events_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues/events{/number}","events_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/events","assignees_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/assignees{/user}","branches_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/branches{/branch}","tags_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/tags","blobs_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/refs{/sha}","trees_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/statuses/{sha}","languages_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/languages","stargazers_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/stargazers","contributors_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/contributors","subscribers_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/subscribers","subscription_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/subscription","commits_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/commits{/sha}","git_commits_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/commits{/sha}","comments_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/comments{/number}","issue_comment_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues/comments{/number}","contents_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/contents/{+path}","compare_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/merges","archive_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/downloads","issues_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues{/number}","pulls_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls{/number}","milestones_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/milestones{/number}","notifications_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/labels{/name}","releases_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/releases{/id}","created_at":"2015-06-01T19:50:24Z","updated_at":"2015-08-13T01:12:07Z","pushed_at":"2015-10-21T21:32:07Z","git_url":"git://github.com/promiscuous-io/promiscuous_black_hole.git","ssh_url":"git@github.com:promiscuous-io/promiscuous_black_hole.git","clone_url":"https://github.com/promiscuous-io/promiscuous_black_hole.git","svn_url":"https://github.com/promiscuous-io/promiscuous_black_hole","homepage":null,"size":250,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"promiscuous-io:master","ref":"master","sha":"d9b788594354777621a36d17ca366a528dd3eb1b","user":{"login":"promiscuous-io","id":5614417,"avatar_url":"https://avatars.githubusercontent.com/u/5614417?v=3","gravatar_id":"","url":"https://api.github.com/users/promiscuous-io","html_url":"https://github.com/promiscuous-io","followers_url":"https://api.github.com/users/promiscuous-io/followers","following_url":"https://api.github.com/users/promiscuous-io/following{/other_user}","gists_url":"https://api.github.com/users/promiscuous-io/gists{/gist_id}","starred_url":"https://api.github.com/users/promiscuous-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/promiscuous-io/subscriptions","organizations_url":"https://api.github.com/users/promiscuous-io/orgs","repos_url":"https://api.github.com/users/promiscuous-io/repos","events_url":"https://api.github.com/users/promiscuous-io/events{/privacy}","received_events_url":"https://api.github.com/users/promiscuous-io/received_events","type":"Organization","site_admin":false},"repo":{"id":36684774,"name":"promiscuous_black_hole","full_name":"promiscuous-io/promiscuous_black_hole","owner":{"login":"promiscuous-io","id":5614417,"avatar_url":"https://avatars.githubusercontent.com/u/5614417?v=3","gravatar_id":"","url":"https://api.github.com/users/promiscuous-io","html_url":"https://github.com/promiscuous-io","followers_url":"https://api.github.com/users/promiscuous-io/followers","following_url":"https://api.github.com/users/promiscuous-io/following{/other_user}","gists_url":"https://api.github.com/users/promiscuous-io/gists{/gist_id}","starred_url":"https://api.github.com/users/promiscuous-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/promiscuous-io/subscriptions","organizations_url":"https://api.github.com/users/promiscuous-io/orgs","repos_url":"https://api.github.com/users/promiscuous-io/repos","events_url":"https://api.github.com/users/promiscuous-io/events{/privacy}","received_events_url":"https://api.github.com/users/promiscuous-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/promiscuous-io/promiscuous_black_hole","description":"","fork":false,"url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole","forks_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/forks","keys_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/teams","hooks_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/hooks","issue_events_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues/events{/number}","events_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/events","assignees_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/assignees{/user}","branches_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/branches{/branch}","tags_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/tags","blobs_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/refs{/sha}","trees_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/statuses/{sha}","languages_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/languages","stargazers_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/stargazers","contributors_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/contributors","subscribers_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/subscribers","subscription_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/subscription","commits_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/commits{/sha}","git_commits_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/git/commits{/sha}","comments_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/comments{/number}","issue_comment_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues/comments{/number}","contents_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/contents/{+path}","compare_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/merges","archive_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/downloads","issues_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues{/number}","pulls_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls{/number}","milestones_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/milestones{/number}","notifications_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/labels{/name}","releases_url":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/releases{/id}","created_at":"2015-06-01T19:50:24Z","updated_at":"2015-08-13T01:12:07Z","pushed_at":"2015-10-21T21:32:07Z","git_url":"git://github.com/promiscuous-io/promiscuous_black_hole.git","ssh_url":"git@github.com:promiscuous-io/promiscuous_black_hole.git","clone_url":"https://github.com/promiscuous-io/promiscuous_black_hole.git","svn_url":"https://github.com/promiscuous-io/promiscuous_black_hole","homepage":null,"size":250,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":2,"forks":2,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/11"},"html":{"href":"https://github.com/promiscuous-io/promiscuous_black_hole/pull/11"},"issue":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues/11"},"comments":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/promiscuous-io/promiscuous_black_hole/statuses/90f264767ddafed2095cbfb6bc9739bcc0d70cec"}}}}