{"action":"closed","number":275,"pull_request":{"url":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls/275","id":38229365,"html_url":"https://github.com/spacewalkproject/spacewalk/pull/275","diff_url":"https://github.com/spacewalkproject/spacewalk/pull/275.diff","patch_url":"https://github.com/spacewalkproject/spacewalk/pull/275.patch","issue_url":"https://api.github.com/repos/spacewalkproject/spacewalk/issues/275","number":275,"state":"closed","locked":false,"title":"Avoid deadlocks when Taskomatic compares configuration files","user":{"login":"moio","id":250541,"avatar_url":"https://avatars.githubusercontent.com/u/250541?v=3","gravatar_id":"","url":"https://api.github.com/users/moio","html_url":"https://github.com/moio","followers_url":"https://api.github.com/users/moio/followers","following_url":"https://api.github.com/users/moio/following{/other_user}","gists_url":"https://api.github.com/users/moio/gists{/gist_id}","starred_url":"https://api.github.com/users/moio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moio/subscriptions","organizations_url":"https://api.github.com/users/moio/orgs","repos_url":"https://api.github.com/users/moio/repos","events_url":"https://api.github.com/users/moio/events{/privacy}","received_events_url":"https://api.github.com/users/moio/received_events","type":"User","site_admin":false},"body":"CompareConfigFilesTask iterates over servers in undefined order, while\r\nrhn_channel.update_needed_cache observes server ID order. Accessing\r\nservers in wrong order could cause deadlocks, Postgres reproducer assuming\r\ntwo systems (1000010000 and 1000010001) below:\r\n\r\n```sql\r\nBEGIN;\r\n\r\nINSERT INTO rhnaction (\r\n    id,\r\n    org_id,\r\n    action_type,\r\n    name,\r\n    scheduler,\r\n    earliest_action,\r\n    version,\r\n    archived,\r\n    prerequisite\r\n)\r\nVALUES (\r\n    6666660,\r\n    1,\r\n    18,\r\n    'Diff',\r\n    1,\r\n    now(),\r\n    2,\r\n    0,\r\n    NULL\r\n);\r\n\r\nINSERT INTO rhnServerAction (\r\n    result_code,\r\n    result_msg,\r\n    pickup_time,\r\n    completion_time,\r\n    remaining_tries,\r\n    status,\r\n    server_id,\r\n    action_id)\r\n    values (NULL,\r\n    NULL,\r\n    NULL,\r\n    NULL,\r\n    5,\r\n    0,\r\n    1000010000,\r\n    6666660\r\n);\r\n\r\n                                    BEGIN;\r\n                                    SELECT rhn_server.update_needed_cache(1000010001);\r\n\r\n                                    SELECT rhn_server.update_needed_cache(1000010000);\r\n\r\nINSERT INTO rhnaction (\r\n    id,\r\n    org_id,\r\n    action_type,\r\n    name,\r\n    scheduler,\r\n    earliest_action,\r\n    version,\r\n    archived,\r\n    prerequisite\r\n)\r\nVALUES (\r\n    6666661,\r\n    1,\r\n    18,\r\n    'Diff',\r\n    1,\r\n    now(),\r\n    2,\r\n    0,\r\n    NULL\r\n);\r\n\r\nINSERT INTO rhnServerAction (\r\n    result_code,\r\n    result_msg,\r\n    pickup_time,\r\n    completion_time,\r\n    remaining_tries,\r\n    status,\r\n    server_id,\r\n    action_id)\r\n    values (NULL,\r\n    NULL,\r\n    NULL,\r\n    NULL,\r\n    5,\r\n    0,\r\n    1000010001,\r\n    6666661\r\n);\r\n\r\n -- ********** Error **********\r\n --\r\n -- ERROR: deadlock detected\r\n -- SQL state: 40P01\r\n -- Detail: Process XXX waits for ShareLock on transaction AAA; blocked by process YYY.\r\n -- Process YYY waits for ShareLock on transaction BBB; blocked by process XXX.\r\n -- Hint: See server log for query details.\r\n -- Context: SQL statement \"SELECT 1 FROM ONLY \"public\".\"rhnserver\" x WHERE \"id\" OPERATOR(pg_catalog.=) $1 FOR  -- SHARE OF x\"\r\n```\r\n","created_at":"2015-06-22T13:06:24Z","updated_at":"2015-06-26T08:41:05Z","closed_at":"2015-06-26T08:41:05Z","merged_at":null,"merge_commit_sha":"858a85c7b0d7e91e7f2ff8c52e21b527010af7da","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls/275/commits","review_comments_url":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls/275/comments","review_comment_url":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spacewalkproject/spacewalk/issues/275/comments","statuses_url":"https://api.github.com/repos/spacewalkproject/spacewalk/statuses/bd9b984ae98aeb2847a846db927ec8ea07f13431","head":{"label":"spacewalkproject:config_file_deadlock","ref":"config_file_deadlock","sha":"bd9b984ae98aeb2847a846db927ec8ea07f13431","user":{"login":"spacewalkproject","id":6648455,"avatar_url":"https://avatars.githubusercontent.com/u/6648455?v=3","gravatar_id":"","url":"https://api.github.com/users/spacewalkproject","html_url":"https://github.com/spacewalkproject","followers_url":"https://api.github.com/users/spacewalkproject/followers","following_url":"https://api.github.com/users/spacewalkproject/following{/other_user}","gists_url":"https://api.github.com/users/spacewalkproject/gists{/gist_id}","starred_url":"https://api.github.com/users/spacewalkproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacewalkproject/subscriptions","organizations_url":"https://api.github.com/users/spacewalkproject/orgs","repos_url":"https://api.github.com/users/spacewalkproject/repos","events_url":"https://api.github.com/users/spacewalkproject/events{/privacy}","received_events_url":"https://api.github.com/users/spacewalkproject/received_events","type":"Organization","site_admin":false},"repo":{"id":17218148,"name":"spacewalk","full_name":"spacewalkproject/spacewalk","owner":{"login":"spacewalkproject","id":6648455,"avatar_url":"https://avatars.githubusercontent.com/u/6648455?v=3","gravatar_id":"","url":"https://api.github.com/users/spacewalkproject","html_url":"https://github.com/spacewalkproject","followers_url":"https://api.github.com/users/spacewalkproject/followers","following_url":"https://api.github.com/users/spacewalkproject/following{/other_user}","gists_url":"https://api.github.com/users/spacewalkproject/gists{/gist_id}","starred_url":"https://api.github.com/users/spacewalkproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacewalkproject/subscriptions","organizations_url":"https://api.github.com/users/spacewalkproject/orgs","repos_url":"https://api.github.com/users/spacewalkproject/repos","events_url":"https://api.github.com/users/spacewalkproject/events{/privacy}","received_events_url":"https://api.github.com/users/spacewalkproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spacewalkproject/spacewalk","description":"The master repository for the Spacewalk Project.","fork":false,"url":"https://api.github.com/repos/spacewalkproject/spacewalk","forks_url":"https://api.github.com/repos/spacewalkproject/spacewalk/forks","keys_url":"https://api.github.com/repos/spacewalkproject/spacewalk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spacewalkproject/spacewalk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spacewalkproject/spacewalk/teams","hooks_url":"https://api.github.com/repos/spacewalkproject/spacewalk/hooks","issue_events_url":"https://api.github.com/repos/spacewalkproject/spacewalk/issues/events{/number}","events_url":"https://api.github.com/repos/spacewalkproject/spacewalk/events","assignees_url":"https://api.github.com/repos/spacewalkproject/spacewalk/assignees{/user}","branches_url":"https://api.github.com/repos/spacewalkproject/spacewalk/branches{/branch}","tags_url":"https://api.github.com/repos/spacewalkproject/spacewalk/tags","blobs_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/refs{/sha}","trees_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spacewalkproject/spacewalk/statuses/{sha}","languages_url":"https://api.github.com/repos/spacewalkproject/spacewalk/languages","stargazers_url":"https://api.github.com/repos/spacewalkproject/spacewalk/stargazers","contributors_url":"https://api.github.com/repos/spacewalkproject/spacewalk/contributors","subscribers_url":"https://api.github.com/repos/spacewalkproject/spacewalk/subscribers","subscription_url":"https://api.github.com/repos/spacewalkproject/spacewalk/subscription","commits_url":"https://api.github.com/repos/spacewalkproject/spacewalk/commits{/sha}","git_commits_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/commits{/sha}","comments_url":"https://api.github.com/repos/spacewalkproject/spacewalk/comments{/number}","issue_comment_url":"https://api.github.com/repos/spacewalkproject/spacewalk/issues/comments{/number}","contents_url":"https://api.github.com/repos/spacewalkproject/spacewalk/contents/{+path}","compare_url":"https://api.github.com/repos/spacewalkproject/spacewalk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spacewalkproject/spacewalk/merges","archive_url":"https://api.github.com/repos/spacewalkproject/spacewalk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spacewalkproject/spacewalk/downloads","issues_url":"https://api.github.com/repos/spacewalkproject/spacewalk/issues{/number}","pulls_url":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls{/number}","milestones_url":"https://api.github.com/repos/spacewalkproject/spacewalk/milestones{/number}","notifications_url":"https://api.github.com/repos/spacewalkproject/spacewalk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spacewalkproject/spacewalk/labels{/name}","releases_url":"https://api.github.com/repos/spacewalkproject/spacewalk/releases{/id}","created_at":"2014-02-26T17:04:20Z","updated_at":"2015-06-13T06:53:59Z","pushed_at":"2015-06-26T08:40:49Z","git_url":"git://github.com/spacewalkproject/spacewalk.git","ssh_url":"git@github.com:spacewalkproject/spacewalk.git","clone_url":"https://github.com/spacewalkproject/spacewalk.git","svn_url":"https://github.com/spacewalkproject/spacewalk","homepage":"www.spacewalkproject.org","size":795263,"stargazers_count":69,"watchers_count":69,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":10,"forks":71,"open_issues":10,"watchers":69,"default_branch":"master"}},"base":{"label":"spacewalkproject:master","ref":"master","sha":"0ff9094f8c107ced72a197482ba09c4eae8227ce","user":{"login":"spacewalkproject","id":6648455,"avatar_url":"https://avatars.githubusercontent.com/u/6648455?v=3","gravatar_id":"","url":"https://api.github.com/users/spacewalkproject","html_url":"https://github.com/spacewalkproject","followers_url":"https://api.github.com/users/spacewalkproject/followers","following_url":"https://api.github.com/users/spacewalkproject/following{/other_user}","gists_url":"https://api.github.com/users/spacewalkproject/gists{/gist_id}","starred_url":"https://api.github.com/users/spacewalkproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacewalkproject/subscriptions","organizations_url":"https://api.github.com/users/spacewalkproject/orgs","repos_url":"https://api.github.com/users/spacewalkproject/repos","events_url":"https://api.github.com/users/spacewalkproject/events{/privacy}","received_events_url":"https://api.github.com/users/spacewalkproject/received_events","type":"Organization","site_admin":false},"repo":{"id":17218148,"name":"spacewalk","full_name":"spacewalkproject/spacewalk","owner":{"login":"spacewalkproject","id":6648455,"avatar_url":"https://avatars.githubusercontent.com/u/6648455?v=3","gravatar_id":"","url":"https://api.github.com/users/spacewalkproject","html_url":"https://github.com/spacewalkproject","followers_url":"https://api.github.com/users/spacewalkproject/followers","following_url":"https://api.github.com/users/spacewalkproject/following{/other_user}","gists_url":"https://api.github.com/users/spacewalkproject/gists{/gist_id}","starred_url":"https://api.github.com/users/spacewalkproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacewalkproject/subscriptions","organizations_url":"https://api.github.com/users/spacewalkproject/orgs","repos_url":"https://api.github.com/users/spacewalkproject/repos","events_url":"https://api.github.com/users/spacewalkproject/events{/privacy}","received_events_url":"https://api.github.com/users/spacewalkproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spacewalkproject/spacewalk","description":"The master repository for the Spacewalk Project.","fork":false,"url":"https://api.github.com/repos/spacewalkproject/spacewalk","forks_url":"https://api.github.com/repos/spacewalkproject/spacewalk/forks","keys_url":"https://api.github.com/repos/spacewalkproject/spacewalk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spacewalkproject/spacewalk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spacewalkproject/spacewalk/teams","hooks_url":"https://api.github.com/repos/spacewalkproject/spacewalk/hooks","issue_events_url":"https://api.github.com/repos/spacewalkproject/spacewalk/issues/events{/number}","events_url":"https://api.github.com/repos/spacewalkproject/spacewalk/events","assignees_url":"https://api.github.com/repos/spacewalkproject/spacewalk/assignees{/user}","branches_url":"https://api.github.com/repos/spacewalkproject/spacewalk/branches{/branch}","tags_url":"https://api.github.com/repos/spacewalkproject/spacewalk/tags","blobs_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/refs{/sha}","trees_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spacewalkproject/spacewalk/statuses/{sha}","languages_url":"https://api.github.com/repos/spacewalkproject/spacewalk/languages","stargazers_url":"https://api.github.com/repos/spacewalkproject/spacewalk/stargazers","contributors_url":"https://api.github.com/repos/spacewalkproject/spacewalk/contributors","subscribers_url":"https://api.github.com/repos/spacewalkproject/spacewalk/subscribers","subscription_url":"https://api.github.com/repos/spacewalkproject/spacewalk/subscription","commits_url":"https://api.github.com/repos/spacewalkproject/spacewalk/commits{/sha}","git_commits_url":"https://api.github.com/repos/spacewalkproject/spacewalk/git/commits{/sha}","comments_url":"https://api.github.com/repos/spacewalkproject/spacewalk/comments{/number}","issue_comment_url":"https://api.github.com/repos/spacewalkproject/spacewalk/issues/comments{/number}","contents_url":"https://api.github.com/repos/spacewalkproject/spacewalk/contents/{+path}","compare_url":"https://api.github.com/repos/spacewalkproject/spacewalk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spacewalkproject/spacewalk/merges","archive_url":"https://api.github.com/repos/spacewalkproject/spacewalk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spacewalkproject/spacewalk/downloads","issues_url":"https://api.github.com/repos/spacewalkproject/spacewalk/issues{/number}","pulls_url":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls{/number}","milestones_url":"https://api.github.com/repos/spacewalkproject/spacewalk/milestones{/number}","notifications_url":"https://api.github.com/repos/spacewalkproject/spacewalk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spacewalkproject/spacewalk/labels{/name}","releases_url":"https://api.github.com/repos/spacewalkproject/spacewalk/releases{/id}","created_at":"2014-02-26T17:04:20Z","updated_at":"2015-06-13T06:53:59Z","pushed_at":"2015-06-26T08:40:49Z","git_url":"git://github.com/spacewalkproject/spacewalk.git","ssh_url":"git@github.com:spacewalkproject/spacewalk.git","clone_url":"https://github.com/spacewalkproject/spacewalk.git","svn_url":"https://github.com/spacewalkproject/spacewalk","homepage":"www.spacewalkproject.org","size":795263,"stargazers_count":69,"watchers_count":69,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":71,"mirror_url":null,"open_issues_count":10,"forks":71,"open_issues":10,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls/275"},"html":{"href":"https://github.com/spacewalkproject/spacewalk/pull/275"},"issue":{"href":"https://api.github.com/repos/spacewalkproject/spacewalk/issues/275"},"comments":{"href":"https://api.github.com/repos/spacewalkproject/spacewalk/issues/275/comments"},"review_comments":{"href":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls/275/comments"},"review_comment":{"href":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spacewalkproject/spacewalk/pulls/275/commits"},"statuses":{"href":"https://api.github.com/repos/spacewalkproject/spacewalk/statuses/bd9b984ae98aeb2847a846db927ec8ea07f13431"}},"merged":false,"mergeable":true,"mergeable_state":"clean","merged_by":null,"comments":1,"review_comments":0,"commits":2,"additions":7,"deletions":5,"changed_files":1}}