{"action":"created","comment":{"url":"https://api.github.com/repos/rails/rails/pulls/comments/61662205","id":61662205,"diff_hunk":"@@ -0,0 +1,53 @@\n+require 'thread'","path":"activerecord/test/cases/schema_loading_test.rb","position":1,"original_position":1,"commit_id":"ba05b3c218568467277ea309dcfd10d34bf8e756","original_commit_id":"ba05b3c218568467277ea309dcfd10d34bf8e756","user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"body":"Thank you @jeremy - very good eye. I found a solution that no longer needed the thread but it got left in.","created_at":"2016-04-30T01:19:56Z","updated_at":"2016-04-30T01:19:56Z","html_url":"https://github.com/rails/rails/pull/24653#discussion_r61662205","pull_request_url":"https://api.github.com/repos/rails/rails/pulls/24653","_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/comments/61662205"},"html":{"href":"https://github.com/rails/rails/pull/24653#discussion_r61662205"},"pull_request":{"href":"https://api.github.com/repos/rails/rails/pulls/24653"}}},"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/24653","id":67208230,"html_url":"https://github.com/rails/rails/pull/24653","diff_url":"https://github.com/rails/rails/pull/24653.diff","patch_url":"https://github.com/rails/rails/pull/24653.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/24653","number":24653,"state":"closed","locked":false,"title":"schema_load triggers 2nd schema_load (via locking)","user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"body":"### Summary\r\n\r\nRails is double loading (`schema_load!`) for all of our models.\r\n\r\n### Details\r\n\r\nCurrently, loading the schema (`schema_load`)\r\naccesses the locking column (`locking_column`)\r\nwhich defaults the value (`reset_locking_column`)\r\nwhich invalidates the schema (`reload_schema_from_cache`)\r\nwhich forces another schema load (`schema_load`).\r\n\r\nGood news:\r\n\r\nThe second `schema_load` does accesses `locking_column`,\r\nbut `locking_column` is set this time through, so it does not call `reset_locking_column`\r\nand it does not trigger an infinite loop.\r\n\r\n### Solution\r\n\r\nI feel `reset_locking_column` should still invalidate the schema.\r\nSo instead, this sets `@locking_column` directly in the default case only.\r\nPlease let me know if you have another solution.\r\n\r\n\r\n/cc @matthewd ","created_at":"2016-04-20T15:30:30Z","updated_at":"2016-04-30T01:19:56Z","closed_at":"2016-04-28T21:54:31Z","merged_at":"2016-04-28T21:54:31Z","merge_commit_sha":"03b62b8420497b393e1e205168961d23ff51ecab","assignee":{"login":"matthewd","id":1034,"avatar_url":"https://avatars.githubusercontent.com/u/1034?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewd","html_url":"https://github.com/matthewd","followers_url":"https://api.github.com/users/matthewd/followers","following_url":"https://api.github.com/users/matthewd/following{/other_user}","gists_url":"https://api.github.com/users/matthewd/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewd/subscriptions","organizations_url":"https://api.github.com/users/matthewd/orgs","repos_url":"https://api.github.com/users/matthewd/repos","events_url":"https://api.github.com/users/matthewd/events{/privacy}","received_events_url":"https://api.github.com/users/matthewd/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/24653/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/24653/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/24653/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/ba05b3c218568467277ea309dcfd10d34bf8e756","head":{"label":"kbrock:kinder_locking_column","ref":"kinder_locking_column","sha":"ba05b3c218568467277ea309dcfd10d34bf8e756","user":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"repo":{"id":6094822,"name":"rails","full_name":"kbrock/rails","owner":{"login":"kbrock","id":1930,"avatar_url":"https://avatars.githubusercontent.com/u/1930?v=3","gravatar_id":"","url":"https://api.github.com/users/kbrock","html_url":"https://github.com/kbrock","followers_url":"https://api.github.com/users/kbrock/followers","following_url":"https://api.github.com/users/kbrock/following{/other_user}","gists_url":"https://api.github.com/users/kbrock/gists{/gist_id}","starred_url":"https://api.github.com/users/kbrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbrock/subscriptions","organizations_url":"https://api.github.com/users/kbrock/orgs","repos_url":"https://api.github.com/users/kbrock/repos","events_url":"https://api.github.com/users/kbrock/events{/privacy}","received_events_url":"https://api.github.com/users/kbrock/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kbrock/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/kbrock/rails","forks_url":"https://api.github.com/repos/kbrock/rails/forks","keys_url":"https://api.github.com/repos/kbrock/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbrock/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbrock/rails/teams","hooks_url":"https://api.github.com/repos/kbrock/rails/hooks","issue_events_url":"https://api.github.com/repos/kbrock/rails/issues/events{/number}","events_url":"https://api.github.com/repos/kbrock/rails/events","assignees_url":"https://api.github.com/repos/kbrock/rails/assignees{/user}","branches_url":"https://api.github.com/repos/kbrock/rails/branches{/branch}","tags_url":"https://api.github.com/repos/kbrock/rails/tags","blobs_url":"https://api.github.com/repos/kbrock/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbrock/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbrock/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbrock/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbrock/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/kbrock/rails/languages","stargazers_url":"https://api.github.com/repos/kbrock/rails/stargazers","contributors_url":"https://api.github.com/repos/kbrock/rails/contributors","subscribers_url":"https://api.github.com/repos/kbrock/rails/subscribers","subscription_url":"https://api.github.com/repos/kbrock/rails/subscription","commits_url":"https://api.github.com/repos/kbrock/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbrock/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbrock/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbrock/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/kbrock/rails/contents/{+path}","compare_url":"https://api.github.com/repos/kbrock/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbrock/rails/merges","archive_url":"https://api.github.com/repos/kbrock/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbrock/rails/downloads","issues_url":"https://api.github.com/repos/kbrock/rails/issues{/number}","pulls_url":"https://api.github.com/repos/kbrock/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/kbrock/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/kbrock/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbrock/rails/labels{/name}","releases_url":"https://api.github.com/repos/kbrock/rails/releases{/id}","deployments_url":"https://api.github.com/repos/kbrock/rails/deployments","created_at":"2012-10-05T18:37:39Z","updated_at":"2015-03-10T00:47:36Z","pushed_at":"2016-04-28T22:00:45Z","git_url":"git://github.com/kbrock/rails.git","ssh_url":"git@github.com:kbrock/rails.git","clone_url":"https://github.com/kbrock/rails.git","svn_url":"https://github.com/kbrock/rails","homepage":"http://rubyonrails.org","size":117140,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"rails:master","ref":"master","sha":"ef5c46d2ee8dc8da20f54dbedc9805f71791d75c","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","deployments_url":"https://api.github.com/repos/rails/rails/deployments","created_at":"2008-04-11T02:19:47Z","updated_at":"2016-04-30T00:16:18Z","pushed_at":"2016-04-30T00:56:03Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":332520,"stargazers_count":30857,"watchers_count":30857,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12521,"mirror_url":null,"open_issues_count":928,"forks":12521,"open_issues":928,"watchers":30857,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/24653"},"html":{"href":"https://github.com/rails/rails/pull/24653"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/24653"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/24653/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/24653/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/24653/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/ba05b3c218568467277ea309dcfd10d34bf8e756"}}}}