{"action":"created","comment":{"url":"https://api.github.com/repos/apache/drill/pulls/comments/48306314","id":48306314,"diff_hunk":"@@ -458,49 +467,46 @@ private void setupSortMemoryAllocations(final PhysicalPlan plan) {\n    */\n   private void acquireQuerySemaphore(final PhysicalPlan plan) throws ForemanSetupException {\n     final OptionManager optionManager = queryContext.getOptions();\n-    final boolean queuingEnabled = optionManager.getOption(ExecConstants.ENABLE_QUEUE);\n-    if (queuingEnabled) {\n-      final long queueThreshold = optionManager.getOption(ExecConstants.QUEUE_THRESHOLD_SIZE);\n-      double totalCost = 0;\n-      for (final PhysicalOperator ops : plan.getSortedOperators()) {\n-        totalCost += ops.getCost();\n-      }\n-\n-      final long queueTimeout = optionManager.getOption(ExecConstants.QUEUE_TIMEOUT);\n-      final String queueName;\n-\n-      try {\n-        @SuppressWarnings(\"resource\")\n-        final ClusterCoordinator clusterCoordinator = drillbitContext.getClusterCoordinator();\n-        final DistributedSemaphore distributedSemaphore;\n-\n-        // get the appropriate semaphore\n-        if (totalCost > queueThreshold) {\n-          final int largeQueue = (int) optionManager.getOption(ExecConstants.LARGE_QUEUE_SIZE);\n-          distributedSemaphore = clusterCoordinator.getSemaphore(\"query.large\", largeQueue);\n-          queueName = \"large\";\n-        } else {\n-          final int smallQueue = (int) optionManager.getOption(ExecConstants.SMALL_QUEUE_SIZE);\n-          distributedSemaphore = clusterCoordinator.getSemaphore(\"query.small\", smallQueue);\n-          queueName = \"small\";\n-        }\n+    final long queueThreshold = optionManager.getOption(ExecConstants.QUEUE_THRESHOLD_SIZE);\n+    double totalCost = 0;\n+    for (final PhysicalOperator ops : plan.getSortedOperators()) {\n+      totalCost += ops.getCost();\n+    }\n \n+    final long queueTimeout = optionManager.getOption(ExecConstants.QUEUE_TIMEOUT);\n+    final String queueName;\n \n-        lease = distributedSemaphore.acquire(queueTimeout, TimeUnit.MILLISECONDS);\n-      } catch (final Exception e) {\n-        throw new ForemanSetupException(\"Unable to acquire slot for query.\", e);\n+    try {\n+      @SuppressWarnings(\"resource\")\n+      final ClusterCoordinator clusterCoordinator = drillbitContext.getClusterCoordinator();\n+      final DistributedSemaphore distributedSemaphore;\n+\n+      // get the appropriate semaphore\n+      if (totalCost > queueThreshold) {\n+        final int largeQueue = (int) optionManager.getOption(ExecConstants.LARGE_QUEUE_SIZE);\n+        distributedSemaphore = clusterCoordinator.getSemaphore(\"query.large\", largeQueue);\n+        queueName = \"large\";\n+      } else {\n+        final int smallQueue = (int) optionManager.getOption(ExecConstants.SMALL_QUEUE_SIZE);\n+        distributedSemaphore = clusterCoordinator.getSemaphore(\"query.small\", smallQueue);\n+        queueName = \"small\";\n       }\n \n-      if (lease == null) {\n-        throw UserException\n-            .resourceError()\n-            .message(\n-                \"Unable to acquire queue resources for query within timeout.  Timeout for %s queue was set at %d seconds.\",\n-                queueName, queueTimeout / 1000)\n-            .build(logger);\n-      }\n+      recordNewState(QueryState.ENQUEUED);","path":"exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java","position":100,"original_position":100,"commit_id":"f108fcf65078d3173c0c4433494ca0d3f4f85de2","original_commit_id":"f108fcf65078d3173c0c4433494ca0d3f4f85de2","user":{"login":"sudheeshkatkam","id":3272600,"avatar_url":"https://avatars.githubusercontent.com/u/3272600?v=3","gravatar_id":"","url":"https://api.github.com/users/sudheeshkatkam","html_url":"https://github.com/sudheeshkatkam","followers_url":"https://api.github.com/users/sudheeshkatkam/followers","following_url":"https://api.github.com/users/sudheeshkatkam/following{/other_user}","gists_url":"https://api.github.com/users/sudheeshkatkam/gists{/gist_id}","starred_url":"https://api.github.com/users/sudheeshkatkam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudheeshkatkam/subscriptions","organizations_url":"https://api.github.com/users/sudheeshkatkam/orgs","repos_url":"https://api.github.com/users/sudheeshkatkam/repos","events_url":"https://api.github.com/users/sudheeshkatkam/events{/privacy}","received_events_url":"https://api.github.com/users/sudheeshkatkam/received_events","type":"User","site_admin":false},"body":"Since the current \"state\" is ENQUEUED, is this required?","created_at":"2015-12-22T22:36:15Z","updated_at":"2015-12-22T22:36:15Z","html_url":"https://github.com/apache/drill/pull/310#discussion_r48306314","pull_request_url":"https://api.github.com/repos/apache/drill/pulls/310","_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/comments/48306314"},"html":{"href":"https://github.com/apache/drill/pull/310#discussion_r48306314"},"pull_request":{"href":"https://api.github.com/repos/apache/drill/pulls/310"}}},"pull_request":{"url":"https://api.github.com/repos/apache/drill/pulls/310","id":54415894,"html_url":"https://github.com/apache/drill/pull/310","diff_url":"https://github.com/apache/drill/pull/310.diff","patch_url":"https://github.com/apache/drill/pull/310.patch","issue_url":"https://api.github.com/repos/apache/drill/issues/310","number":310,"state":"open","locked":false,"title":"DRILL-4187: introduce a new query state ENQUEUED and rename the state PENDING to STARTING","user":{"login":"hnfgns","id":3476250,"avatar_url":"https://avatars.githubusercontent.com/u/3476250?v=3","gravatar_id":"","url":"https://api.github.com/users/hnfgns","html_url":"https://github.com/hnfgns","followers_url":"https://api.github.com/users/hnfgns/followers","following_url":"https://api.github.com/users/hnfgns/following{/other_user}","gists_url":"https://api.github.com/users/hnfgns/gists{/gist_id}","starred_url":"https://api.github.com/users/hnfgns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hnfgns/subscriptions","organizations_url":"https://api.github.com/users/hnfgns/orgs","repos_url":"https://api.github.com/users/hnfgns/repos","events_url":"https://api.github.com/users/hnfgns/events{/privacy}","received_events_url":"https://api.github.com/users/hnfgns/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-22T21:17:01Z","updated_at":"2015-12-22T22:36:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32a8e6faf60359362ba4c4d955e1ce8b9677f692","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/drill/pulls/310/commits","review_comments_url":"https://api.github.com/repos/apache/drill/pulls/310/comments","review_comment_url":"https://api.github.com/repos/apache/drill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/drill/issues/310/comments","statuses_url":"https://api.github.com/repos/apache/drill/statuses/f108fcf65078d3173c0c4433494ca0d3f4f85de2","head":{"label":"hnfgns:DRILL-4187","ref":"DRILL-4187","sha":"f108fcf65078d3173c0c4433494ca0d3f4f85de2","user":{"login":"hnfgns","id":3476250,"avatar_url":"https://avatars.githubusercontent.com/u/3476250?v=3","gravatar_id":"","url":"https://api.github.com/users/hnfgns","html_url":"https://github.com/hnfgns","followers_url":"https://api.github.com/users/hnfgns/followers","following_url":"https://api.github.com/users/hnfgns/following{/other_user}","gists_url":"https://api.github.com/users/hnfgns/gists{/gist_id}","starred_url":"https://api.github.com/users/hnfgns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hnfgns/subscriptions","organizations_url":"https://api.github.com/users/hnfgns/orgs","repos_url":"https://api.github.com/users/hnfgns/repos","events_url":"https://api.github.com/users/hnfgns/events{/privacy}","received_events_url":"https://api.github.com/users/hnfgns/received_events","type":"User","site_admin":false},"repo":{"id":22357423,"name":"incubator-drill","full_name":"hnfgns/incubator-drill","owner":{"login":"hnfgns","id":3476250,"avatar_url":"https://avatars.githubusercontent.com/u/3476250?v=3","gravatar_id":"","url":"https://api.github.com/users/hnfgns","html_url":"https://github.com/hnfgns","followers_url":"https://api.github.com/users/hnfgns/followers","following_url":"https://api.github.com/users/hnfgns/following{/other_user}","gists_url":"https://api.github.com/users/hnfgns/gists{/gist_id}","starred_url":"https://api.github.com/users/hnfgns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hnfgns/subscriptions","organizations_url":"https://api.github.com/users/hnfgns/orgs","repos_url":"https://api.github.com/users/hnfgns/repos","events_url":"https://api.github.com/users/hnfgns/events{/privacy}","received_events_url":"https://api.github.com/users/hnfgns/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hnfgns/incubator-drill","description":"Mirror of Apache Drill","fork":true,"url":"https://api.github.com/repos/hnfgns/incubator-drill","forks_url":"https://api.github.com/repos/hnfgns/incubator-drill/forks","keys_url":"https://api.github.com/repos/hnfgns/incubator-drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hnfgns/incubator-drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hnfgns/incubator-drill/teams","hooks_url":"https://api.github.com/repos/hnfgns/incubator-drill/hooks","issue_events_url":"https://api.github.com/repos/hnfgns/incubator-drill/issues/events{/number}","events_url":"https://api.github.com/repos/hnfgns/incubator-drill/events","assignees_url":"https://api.github.com/repos/hnfgns/incubator-drill/assignees{/user}","branches_url":"https://api.github.com/repos/hnfgns/incubator-drill/branches{/branch}","tags_url":"https://api.github.com/repos/hnfgns/incubator-drill/tags","blobs_url":"https://api.github.com/repos/hnfgns/incubator-drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hnfgns/incubator-drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hnfgns/incubator-drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/hnfgns/incubator-drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hnfgns/incubator-drill/statuses/{sha}","languages_url":"https://api.github.com/repos/hnfgns/incubator-drill/languages","stargazers_url":"https://api.github.com/repos/hnfgns/incubator-drill/stargazers","contributors_url":"https://api.github.com/repos/hnfgns/incubator-drill/contributors","subscribers_url":"https://api.github.com/repos/hnfgns/incubator-drill/subscribers","subscription_url":"https://api.github.com/repos/hnfgns/incubator-drill/subscription","commits_url":"https://api.github.com/repos/hnfgns/incubator-drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/hnfgns/incubator-drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/hnfgns/incubator-drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/hnfgns/incubator-drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/hnfgns/incubator-drill/contents/{+path}","compare_url":"https://api.github.com/repos/hnfgns/incubator-drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hnfgns/incubator-drill/merges","archive_url":"https://api.github.com/repos/hnfgns/incubator-drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hnfgns/incubator-drill/downloads","issues_url":"https://api.github.com/repos/hnfgns/incubator-drill/issues{/number}","pulls_url":"https://api.github.com/repos/hnfgns/incubator-drill/pulls{/number}","milestones_url":"https://api.github.com/repos/hnfgns/incubator-drill/milestones{/number}","notifications_url":"https://api.github.com/repos/hnfgns/incubator-drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hnfgns/incubator-drill/labels{/name}","releases_url":"https://api.github.com/repos/hnfgns/incubator-drill/releases{/id}","created_at":"2014-07-28T20:50:07Z","updated_at":"2015-04-28T20:48:18Z","pushed_at":"2015-12-17T18:46:28Z","git_url":"git://github.com/hnfgns/incubator-drill.git","ssh_url":"git@github.com:hnfgns/incubator-drill.git","clone_url":"https://github.com/hnfgns/incubator-drill.git","svn_url":"https://github.com/hnfgns/incubator-drill","homepage":"","size":22795,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"apache:master","ref":"master","sha":"1ea3d6c3f144614caf460648c1c27c6d0f5b06b8","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":5683653,"name":"drill","full_name":"apache/drill","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/drill","description":"Mirror of Apache Drill","fork":false,"url":"https://api.github.com/repos/apache/drill","forks_url":"https://api.github.com/repos/apache/drill/forks","keys_url":"https://api.github.com/repos/apache/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/drill/teams","hooks_url":"https://api.github.com/repos/apache/drill/hooks","issue_events_url":"https://api.github.com/repos/apache/drill/issues/events{/number}","events_url":"https://api.github.com/repos/apache/drill/events","assignees_url":"https://api.github.com/repos/apache/drill/assignees{/user}","branches_url":"https://api.github.com/repos/apache/drill/branches{/branch}","tags_url":"https://api.github.com/repos/apache/drill/tags","blobs_url":"https://api.github.com/repos/apache/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/drill/languages","stargazers_url":"https://api.github.com/repos/apache/drill/stargazers","contributors_url":"https://api.github.com/repos/apache/drill/contributors","subscribers_url":"https://api.github.com/repos/apache/drill/subscribers","subscription_url":"https://api.github.com/repos/apache/drill/subscription","commits_url":"https://api.github.com/repos/apache/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/drill/contents/{+path}","compare_url":"https://api.github.com/repos/apache/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/drill/merges","archive_url":"https://api.github.com/repos/apache/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/drill/downloads","issues_url":"https://api.github.com/repos/apache/drill/issues{/number}","pulls_url":"https://api.github.com/repos/apache/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/drill/labels{/name}","releases_url":"https://api.github.com/repos/apache/drill/releases{/id}","created_at":"2012-09-05T07:00:26Z","updated_at":"2015-12-21T14:28:56Z","pushed_at":"2015-12-22T21:20:46Z","git_url":"git://github.com/apache/drill.git","ssh_url":"git@github.com:apache/drill.git","clone_url":"https://github.com/apache/drill.git","svn_url":"https://github.com/apache/drill","homepage":"","size":43572,"stargazers_count":529,"watchers_count":529,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":351,"mirror_url":"git://git.apache.org/drill.git","open_issues_count":57,"forks":351,"open_issues":57,"watchers":529,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/310"},"html":{"href":"https://github.com/apache/drill/pull/310"},"issue":{"href":"https://api.github.com/repos/apache/drill/issues/310"},"comments":{"href":"https://api.github.com/repos/apache/drill/issues/310/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/drill/pulls/310/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/drill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/drill/pulls/310/commits"},"statuses":{"href":"https://api.github.com/repos/apache/drill/statuses/f108fcf65078d3173c0c4433494ca0d3f4f85de2"}}}}