{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/60963173","id":60963173,"diff_hunk":"@@ -81,25 +82,38 @@ public QueryQueueRuleFactory(QueryManagerConfig config, ObjectMapper mapper)\n                 rules.add(QueryQueueRule.createRule(rule.getUserRegex(), rule.getSourceRegex(), rule.getSessionPropertyRegexes(), rule.getQueues(), definitions));\n             }\n         }\n-        checkIsDAG(rules.build());\n+        checkIsTree(rules.build());\n         this.selectors = rules.build();\n     }\n \n-    private static void checkIsDAG(List<QueryQueueRule> rules)\n+    private static void checkIsTree(List<QueryQueueRule> rules)\n     {\n-        DirectedPseudograph<String, DefaultEdge> graph = new DirectedPseudograph<>(DefaultEdge.class);\n+        DirectedGraph<String, DefaultEdge> graph = new DefaultDirectedGraph<>(DefaultEdge.class);\n         for (QueryQueueRule rule : rules) {\n             String lastQueueName = null;\n             for (QueryQueueDefinition queue : rule.getQueues()) {\n                 String currentQueueName = queue.getTemplate();\n                 graph.addVertex(currentQueueName);\n                 if (lastQueueName != null) {\n+                    if (lastQueueName.equals(currentQueueName)) {\n+                        throw new IllegalArgumentException(\"Queues must form a tree. Rules contain a loop for \" + currentQueueName);","path":"presto-main/src/main/java/com/facebook/presto/execution/QueryQueueRuleFactory.java","position":39,"original_position":39,"commit_id":"24398d800e2cb00f1e7c9529569c9dbac92fcfd2","original_commit_id":"24398d800e2cb00f1e7c9529569c9dbac92fcfd2","user":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"body":"I don't know what that means, so try to pick a message that normal users will be able to understand what is wrong and how to fix it.","created_at":"2016-04-25T18:27:54Z","updated_at":"2016-04-25T18:27:54Z","html_url":"https://github.com/prestodb/presto/pull/5021#discussion_r60963173","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/5021","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/60963173"},"html":{"href":"https://github.com/prestodb/presto/pull/5021#discussion_r60963173"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5021"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/5021","id":66427722,"html_url":"https://github.com/prestodb/presto/pull/5021","diff_url":"https://github.com/prestodb/presto/pull/5021.diff","patch_url":"https://github.com/prestodb/presto/pull/5021.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/5021","number":5021,"state":"open","locked":false,"title":"Force queue rules to form a tree","user":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"body":"Previously, queue rules could create DAGs of queues. This leads to\r\nconfusing edge cases and will not be supported in the v2 resource\r\nmanagement system that is being worked on.","created_at":"2016-04-14T04:30:25Z","updated_at":"2016-04-25T18:27:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3693c3d22efec5b2ddecea8c94ea2da9a49786c2","assignee":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/5021/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/5021/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/5021/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/24398d800e2cb00f1e7c9529569c9dbac92fcfd2","head":{"label":"cberner:tree","ref":"tree","sha":"24398d800e2cb00f1e7c9529569c9dbac92fcfd2","user":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"repo":{"id":10272630,"name":"presto","full_name":"cberner/presto","owner":{"login":"cberner","id":842688,"avatar_url":"https://avatars.githubusercontent.com/u/842688?v=3","gravatar_id":"","url":"https://api.github.com/users/cberner","html_url":"https://github.com/cberner","followers_url":"https://api.github.com/users/cberner/followers","following_url":"https://api.github.com/users/cberner/following{/other_user}","gists_url":"https://api.github.com/users/cberner/gists{/gist_id}","starred_url":"https://api.github.com/users/cberner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cberner/subscriptions","organizations_url":"https://api.github.com/users/cberner/orgs","repos_url":"https://api.github.com/users/cberner/repos","events_url":"https://api.github.com/users/cberner/events{/privacy}","received_events_url":"https://api.github.com/users/cberner/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cberner/presto","description":"","fork":true,"url":"https://api.github.com/repos/cberner/presto","forks_url":"https://api.github.com/repos/cberner/presto/forks","keys_url":"https://api.github.com/repos/cberner/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cberner/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cberner/presto/teams","hooks_url":"https://api.github.com/repos/cberner/presto/hooks","issue_events_url":"https://api.github.com/repos/cberner/presto/issues/events{/number}","events_url":"https://api.github.com/repos/cberner/presto/events","assignees_url":"https://api.github.com/repos/cberner/presto/assignees{/user}","branches_url":"https://api.github.com/repos/cberner/presto/branches{/branch}","tags_url":"https://api.github.com/repos/cberner/presto/tags","blobs_url":"https://api.github.com/repos/cberner/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cberner/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cberner/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/cberner/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cberner/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/cberner/presto/languages","stargazers_url":"https://api.github.com/repos/cberner/presto/stargazers","contributors_url":"https://api.github.com/repos/cberner/presto/contributors","subscribers_url":"https://api.github.com/repos/cberner/presto/subscribers","subscription_url":"https://api.github.com/repos/cberner/presto/subscription","commits_url":"https://api.github.com/repos/cberner/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/cberner/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/cberner/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/cberner/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/cberner/presto/contents/{+path}","compare_url":"https://api.github.com/repos/cberner/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cberner/presto/merges","archive_url":"https://api.github.com/repos/cberner/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cberner/presto/downloads","issues_url":"https://api.github.com/repos/cberner/presto/issues{/number}","pulls_url":"https://api.github.com/repos/cberner/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/cberner/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/cberner/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cberner/presto/labels{/name}","releases_url":"https://api.github.com/repos/cberner/presto/releases{/id}","deployments_url":"https://api.github.com/repos/cberner/presto/deployments","created_at":"2013-05-24T18:37:52Z","updated_at":"2016-03-18T20:43:12Z","pushed_at":"2016-04-21T04:54:25Z","git_url":"git://github.com/cberner/presto.git","ssh_url":"git@github.com:cberner/presto.git","clone_url":"https://github.com/cberner/presto.git","svn_url":"https://github.com/cberner/presto","homepage":null,"size":49648,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"prestodb:master","ref":"master","sha":"84f10868377eafb7274d7f063bffcbce8cfc7a82","user":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"prestodb/presto","owner":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prestodb/presto","description":"Distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestodb/presto","forks_url":"https://api.github.com/repos/prestodb/presto/forks","keys_url":"https://api.github.com/repos/prestodb/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestodb/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestodb/presto/teams","hooks_url":"https://api.github.com/repos/prestodb/presto/hooks","issue_events_url":"https://api.github.com/repos/prestodb/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestodb/presto/events","assignees_url":"https://api.github.com/repos/prestodb/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestodb/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestodb/presto/tags","blobs_url":"https://api.github.com/repos/prestodb/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestodb/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestodb/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestodb/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestodb/presto/languages","stargazers_url":"https://api.github.com/repos/prestodb/presto/stargazers","contributors_url":"https://api.github.com/repos/prestodb/presto/contributors","subscribers_url":"https://api.github.com/repos/prestodb/presto/subscribers","subscription_url":"https://api.github.com/repos/prestodb/presto/subscription","commits_url":"https://api.github.com/repos/prestodb/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestodb/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestodb/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestodb/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestodb/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestodb/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestodb/presto/merges","archive_url":"https://api.github.com/repos/prestodb/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestodb/presto/downloads","issues_url":"https://api.github.com/repos/prestodb/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestodb/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestodb/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestodb/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestodb/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestodb/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestodb/presto/deployments","created_at":"2012-08-09T01:03:37Z","updated_at":"2016-04-25T18:12:45Z","pushed_at":"2016-04-25T18:25:14Z","git_url":"git://github.com/prestodb/presto.git","ssh_url":"git@github.com:prestodb/presto.git","clone_url":"https://github.com/prestodb/presto.git","svn_url":"https://github.com/prestodb/presto","homepage":"https://prestodb.io","size":148691,"stargazers_count":4691,"watchers_count":4691,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1360,"mirror_url":null,"open_issues_count":564,"forks":1360,"open_issues":564,"watchers":4691,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5021"},"html":{"href":"https://github.com/prestodb/presto/pull/5021"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/5021"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/5021/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5021/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5021/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/24398d800e2cb00f1e7c9529569c9dbac92fcfd2"}}}}