[ 
https://issues.apache.org/jira/browse/DRILL-5571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16685687#comment-16685687
 ] 

ASF GitHub Bot commented on DRILL-5571:
---------------------------------------

kkhatua closed pull request #1531: DRILL-5571: Cancel running query from its 
Web UI
URL: https://github.com/apache/drill/pull/1531
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/exec/java-exec/src/main/resources/rest/profile/profile.ftl 
b/exec/java-exec/src/main/resources/rest/profile/profile.ftl
index c14e1b2e97d..cbef5487453 100644
--- a/exec/java-exec/src/main/resources/rest/profile/profile.ftl
+++ b/exec/java-exec/src/main/resources/rest/profile/profile.ftl
@@ -50,6 +50,22 @@
         "info": false
       }
     );} );
+
+    //Close the cancellation status popup
+    function refreshStatus() {
+      //Close PopUp Modal
+      $("#queryCancelModal").modal("hide");
+      location.reload(true);
+    }
+
+    //Cancel query & show cancellation status
+    function cancelQuery() {
+      document.getElementById("cancelTitle").innerHTML = "Drillbit on " + 
location.hostname + " says";
+      $.get("/profiles/cancel/"+globalconfig.queryid, function(data, 
status){/*Not Tracking Response*/});
+      //Show PopUp Modal
+      $("#queryCancelModal").modal("show");
+    };
+
 </script>
 <style>
 /* DataTables Sorting: inherited via sortable class */
@@ -63,6 +79,7 @@ table.sortable thead .sorting { background-image: 
url("/static/img/black-unsorte
 table.sortable thead .sorting_asc { background-image: 
url("/static/img/black-asc.gif"); }
 table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-desc.gif"); }
 </style>
+
 </#macro>
 
 <#macro page_body>
@@ -171,7 +188,30 @@ table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-de
   <#assign queued = queueName != "" && queueName != "-" />
 
   <div class="page-header"></div>
-  <h3>Query Profile : <span 
style='font-size:85%'>${model.getQueryId()}</span></h3>
+  <h3>Query Profile: <span style='font-size:85%'>${model.getQueryId()}</span>
+  <#if model.getQueryStateDisplayName() == "Prepared" || 
model.getQueryStateDisplayName() == "Planning" || 
model.getQueryStateDisplayName() == "Enqueued" || 
model.getQueryStateDisplayName() == "Starting">
+    <div  style="display: inline-block;">
+      <button type="button" id="cancelBtn" class="btn btn-warning btn-sm" 
onclick="cancelQuery()" > Cancel </button>
+    </div>
+
+  <!-- Cancellation Modal -->
+  <div class="modal fade" id="queryCancelModal" role="dialog">
+    <div class="modal-dialog">
+      <div class="modal-content">
+        <div class="modal-header">
+          <button type="button" class="close" data-dismiss="modal" 
onclick="refreshStatus()">&times;</button>
+          <h4 class="modal-title" id="cancelTitle"></h4>
+        </div>
+        <div class="modal-body" style="line-height:2">
+          Cancellation issued for Query ID:<br>${model.getQueryId()}
+        </div>
+        <div class="modal-footer"><button type="button" class="btn 
btn-default" onclick="refreshStatus()">Close</button></div>
+      </div>
+    </div>
+  </div>
+  </#if>
+  </h3>
+  
   <div class="panel-group" id="query-profile-accordion">
     <div class="panel panel-default">
       <div class="panel-heading">
@@ -214,7 +254,7 @@ table.sortable thead .sorting_desc { background-image: 
url("/static/img/black-de
     <div class="panel panel-default">
       <div class="panel-heading">
         <h4 class="panel-title">
-          <a data-toggle="collapse" href="#query-profile-duration">
+          <a data-toggle="collapse" href="#query-profile-duration in">
              Duration
           </a>
         </h4>


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Unable to cancel running queries from Web UI
> --------------------------------------------
>
>                 Key: DRILL-5571
>                 URL: https://issues.apache.org/jira/browse/DRILL-5571
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - HTTP
>    Affects Versions: 1.11.0
>            Reporter: Kedar Sankar Behera
>            Assignee: Kunal Khatua
>            Priority: Major
>              Labels: ready-to-commit
>             Fix For: 1.15.0
>
>
> We are unable to access profiles of some running queries. Hit the following 
> error on the Web UI:
> {code}
> {
>   “errorMessage” : “VALIDATION ERROR: No profile with given query id 
> ‘26c90b95-928b-15e3-bedc-bfb4a046cc8b’ exists. Please verify the query 
> id.\n\n\n[Error Id: e6896a23-6932-469d-9968-d315fdd06dd4 ]”
> }
> {code}
> And we cannot cancel the running queries whose profile page can be accessed:
> {code}
> Failure attempting to cancel query 26c90b33-cf7e-0495-8f76-55220f71f809.  
> Unable to find information about where query is actively running.
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to