{"action":"created","comment":{"url":"https://api.github.com/repos/apache/drill/pulls/comments/148868884","pull_request_review_id":73372289,"id":148868884,"diff_hunk":"@@ -165,32 +176,60 @@ public DrillbitContext getContext() {\n    *\n    * <p>This is intended to be used by {@link org.apache.drill.exec.server.Drillbit#close()}.</p>\n    */\n-  public void waitToExit() {\n+  public void waitToExit(Drillbit bit, boolean forcceful_shutdown) {\n     synchronized(this) {\n-      if (queries.isEmpty() && runningFragments.isEmpty()) {\n+      numOfRunningQueries = queries.size();\n+      numOfRunningFragments = runningFragments.size();\n+      if ( queries.isEmpty() && runningFragments.isEmpty()) {\n         return;\n       }\n-\n+      logger.info(\"Draining \" + queries +\" queries and \"+ runningFragments+\" fragments.\");\n       exitLatch = new ExtendedLatch();\n     }\n-\n-    // Wait for at most 5 seconds or until the latch is released.\n-    exitLatch.awaitUninterruptibly(5000);\n+    // Wait uninterruptibly until all the queries and running fragments on that drillbit goes down\n+    // to zero\n+    if( forcceful_shutdown) {\n+      exitLatch.awaitUninterruptibly(5000);\n+    }\n+    else {","path":"exec/java-exec/src/main/java/org/apache/drill/exec/work/WorkManager.java","position":57,"original_position":57,"commit_id":"0a39174e422aa30fd0b516652a76f156086e7ef8","original_commit_id":"0a39174e422aa30fd0b516652a76f156086e7ef8","user":{"login":"bitblender","id":430469,"avatar_url":"https://avatars3.githubusercontent.com/u/430469?v=4","gravatar_id":"","url":"https://api.github.com/users/bitblender","html_url":"https://github.com/bitblender","followers_url":"https://api.github.com/users/bitblender/followers","following_url":"https://api.github.com/users/bitblender/following{/other_user}","gists_url":"https://api.github.com/users/bitblender/gists{/gist_id}","starred_url":"https://api.github.com/users/bitblender/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitblender/subscriptions","organizations_url":"https://api.github.com/users/bitblender/orgs","repos_url":"https://api.github.com/users/bitblender/repos","events_url":"https://api.github.com/users/bitblender/events{/privacy}","received_events_url":"https://api.github.com/users/bitblender/received_events","type":"User","site_admin":false},"body":"Inconsistent if-else formatting","created_at":"2017-11-03T19:00:21Z","updated_at":"2017-11-03T19:37:47Z","html_url":"https://github.com/apache/drill/pull/921#discussion_r148868884","pull_request_url":"https://api.github.com/repos/apache/drill/pulls/921","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/comments/148868884"},"html":{"href":"https://github.com/apache/drill/pull/921#discussion_r148868884"},"pull_request":{"href":"https://api.github.com/repos/apache/drill/pulls/921"}}},"pull_request":{"url":"https://api.github.com/repos/apache/drill/pulls/921","id":137713069,"html_url":"https://github.com/apache/drill/pull/921","diff_url":"https://github.com/apache/drill/pull/921.diff","patch_url":"https://github.com/apache/drill/pull/921.patch","issue_url":"https://api.github.com/repos/apache/drill/issues/921","number":921,"state":"open","locked":false,"title":"DRILL-4286 Graceful shutdown of drillbit","user":{"login":"dvjyothsna","id":10828072,"avatar_url":"https://avatars0.githubusercontent.com/u/10828072?v=4","gravatar_id":"","url":"https://api.github.com/users/dvjyothsna","html_url":"https://github.com/dvjyothsna","followers_url":"https://api.github.com/users/dvjyothsna/followers","following_url":"https://api.github.com/users/dvjyothsna/following{/other_user}","gists_url":"https://api.github.com/users/dvjyothsna/gists{/gist_id}","starred_url":"https://api.github.com/users/dvjyothsna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvjyothsna/subscriptions","organizations_url":"https://api.github.com/users/dvjyothsna/orgs","repos_url":"https://api.github.com/users/dvjyothsna/repos","events_url":"https://api.github.com/users/dvjyothsna/events{/privacy}","received_events_url":"https://api.github.com/users/dvjyothsna/received_events","type":"User","site_admin":false},"body":"Following is the design document https://docs.google.com/document/d/1AauIwVCjsBKBSbbU6sQODErrEp7n3IwniMtgK4m09MQ/edit#heading=h.224lbmcaxu2d.\r\n\r\nI will be doing minor modifications and adding more tests for a couple of days.\r\n\r\nNOTE : PCAP_SUB_SCAN in UserBitShared.proto is missing. I have added that since I made some changes to protobuf and generated code. Once it is added as part of DRILL-5432 I will remove it from my commit.\r\n\r\nTODOS: \r\n- Adding Cors support in WebUI.\r\n- Post request to put the Drillbit in offline mode. (Estimate - 2 days)\r\n- Allow port hunting for unit tests. Drillbit allows port hunting only in embedded mode. But port hunting is needed in scenarios where unit tests require running multiple drillbits on the same machine with Zookeeper. (Need some discussion)\r\n               \r\n\r\n\r\n","created_at":"2017-08-25T16:39:40Z","updated_at":"2017-11-03T19:37:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6e89465a722499f5a3c3ea753f66327d1470c79","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/drill/pulls/921/commits","review_comments_url":"https://api.github.com/repos/apache/drill/pulls/921/comments","review_comment_url":"https://api.github.com/repos/apache/drill/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/drill/issues/921/comments","statuses_url":"https://api.github.com/repos/apache/drill/statuses/0a39174e422aa30fd0b516652a76f156086e7ef8","head":{"label":"dvjyothsna:DRILL-4286","ref":"DRILL-4286","sha":"0a39174e422aa30fd0b516652a76f156086e7ef8","user":{"login":"dvjyothsna","id":10828072,"avatar_url":"https://avatars0.githubusercontent.com/u/10828072?v=4","gravatar_id":"","url":"https://api.github.com/users/dvjyothsna","html_url":"https://github.com/dvjyothsna","followers_url":"https://api.github.com/users/dvjyothsna/followers","following_url":"https://api.github.com/users/dvjyothsna/following{/other_user}","gists_url":"https://api.github.com/users/dvjyothsna/gists{/gist_id}","starred_url":"https://api.github.com/users/dvjyothsna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvjyothsna/subscriptions","organizations_url":"https://api.github.com/users/dvjyothsna/orgs","repos_url":"https://api.github.com/users/dvjyothsna/repos","events_url":"https://api.github.com/users/dvjyothsna/events{/privacy}","received_events_url":"https://api.github.com/users/dvjyothsna/received_events","type":"User","site_admin":false},"repo":{"id":92445628,"name":"drill","full_name":"dvjyothsna/drill","owner":{"login":"dvjyothsna","id":10828072,"avatar_url":"https://avatars0.githubusercontent.com/u/10828072?v=4","gravatar_id":"","url":"https://api.github.com/users/dvjyothsna","html_url":"https://github.com/dvjyothsna","followers_url":"https://api.github.com/users/dvjyothsna/followers","following_url":"https://api.github.com/users/dvjyothsna/following{/other_user}","gists_url":"https://api.github.com/users/dvjyothsna/gists{/gist_id}","starred_url":"https://api.github.com/users/dvjyothsna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvjyothsna/subscriptions","organizations_url":"https://api.github.com/users/dvjyothsna/orgs","repos_url":"https://api.github.com/users/dvjyothsna/repos","events_url":"https://api.github.com/users/dvjyothsna/events{/privacy}","received_events_url":"https://api.github.com/users/dvjyothsna/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dvjyothsna/drill","description":"Mirror of Apache Drill","fork":true,"url":"https://api.github.com/repos/dvjyothsna/drill","forks_url":"https://api.github.com/repos/dvjyothsna/drill/forks","keys_url":"https://api.github.com/repos/dvjyothsna/drill/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dvjyothsna/drill/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dvjyothsna/drill/teams","hooks_url":"https://api.github.com/repos/dvjyothsna/drill/hooks","issue_events_url":"https://api.github.com/repos/dvjyothsna/drill/issues/events{/number}","events_url":"https://api.github.com/repos/dvjyothsna/drill/events","assignees_url":"https://api.github.com/repos/dvjyothsna/drill/assignees{/user}","branches_url":"https://api.github.com/repos/dvjyothsna/drill/branches{/branch}","tags_url":"https://api.github.com/repos/dvjyothsna/drill/tags","blobs_url":"https://api.github.com/repos/dvjyothsna/drill/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dvjyothsna/drill/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dvjyothsna/drill/git/refs{/sha}","trees_url":"https://api.github.com/repos/dvjyothsna/drill/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dvjyothsna/drill/statuses/{sha}","languages_url":"https://api.github.com/repos/dvjyothsna/drill/languages","stargazers_url":"https://api.github.com/repos/dvjyothsna/drill/stargazers","contributors_url":"https://api.github.com/repos/dvjyothsna/drill/contributors","subscribers_url":"https://api.github.com/repos/dvjyothsna/drill/subscribers","subscription_url":"https://api.github.com/repos/dvjyothsna/drill/subscription","commits_url":"https://api.github.com/repos/dvjyothsna/drill/commits{/sha}","git_commits_url":"https://api.github.com/repos/dvjyothsna/drill/git/commits{/sha}","comments_url":"https://api.github.com/repos/dvjyothsna/drill/comments{/number}","issue_comment_url":"https://api.github.com/repos/dvjyothsna/drill/issues/comments{/number}","contents_url":"https://api.github.com/repos/dvjyothsna/drill/contents/{+path}","compare_url":"https://api.github.com/repos/dvjyothsna/drill/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dvjyothsna/drill/merges","archive_url":"https://api.github.com/repos/dvjyothsna/drill/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dvjyothsna/drill/downloads","issues_url":"https://api.github.com/repos/dvjyothsna/drill/issues{/number}","pulls_url":"https://api.github.com/repos/dvjyothsna/drill/pulls{/number}","milestones_url":"https://api.github.com/repos/dvjyothsna/drill/milestones{/number}","notifications_url":"https://api.github.com/repos/dvjyothsna/drill/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dvjyothsna/drill/labels{/name}","releases_url":"https://api.github.com/repos/dvjyothsna/drill/releases{/id}","deployments_url":"https://api.github.com/repos/dvjyothsna/drill/deployments","created_at":"2017-05-25T21:23:41Z","updated_at":"2017-05-25T21:23:51Z","pushed_at":"2017-10-31T18:17:21Z","git_url":"git://github.com/dvjyothsna/drill.git","ssh_url":"git@github.com:dvjyothsna/drill.git","clone_url":"https://github.com/dvjyothsna/drill.git","svn_url":"https://github.com/dvjyothsna/drill","homepage":"","size":50395,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"e4938c0942e3906124b3f81f58fd7e95cc128844","user":{"login":"apache","id":47359,"avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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://avatars0.githubusercontent.com/u/47359?v=4","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}","deployments_url":"https://api.github.com/repos/apache/drill/deployments","created_at":"2012-09-05T07:00:26Z","updated_at":"2017-11-03T01:55:59Z","pushed_at":"2017-11-03T17:46:52Z","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":51304,"stargazers_count":870,"watchers_count":870,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":596,"mirror_url":"git://git.apache.org/drill.git","archived":false,"open_issues_count":153,"forks":596,"open_issues":153,"watchers":870,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/drill/pulls/921"},"html":{"href":"https://github.com/apache/drill/pull/921"},"issue":{"href":"https://api.github.com/repos/apache/drill/issues/921"},"comments":{"href":"https://api.github.com/repos/apache/drill/issues/921/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/drill/pulls/921/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/drill/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/drill/pulls/921/commits"},"statuses":{"href":"https://api.github.com/repos/apache/drill/statuses/0a39174e422aa30fd0b516652a76f156086e7ef8"}},"author_association":"NONE"}}
{"actor":{"display_login":"bitblender"}}