mingmwang commented on code in PR #146:
URL: https://github.com/apache/arrow-ballista/pull/146#discussion_r948912817


##########
ballista/rust/executor/src/executor_server.rs:
##########
@@ -411,4 +411,31 @@ impl<T: 'static + AsLogicalPlan, U: 'static + 
AsExecutionPlan> ExecutorGrpc
     ) -> Result<Response<StopExecutorResult>, Status> {
         todo!()
     }
+
+    async fn cancel_tasks(
+        &self,
+        request: Request<CancelTasksParams>,
+    ) -> Result<Response<CancelTasksResult>, Status> {
+        let partitions = request.into_inner().partition_id;
+        info!("Cancelling partition tasks for {:?}", partitions);
+
+        let mut cancelled = true;
+
+        for partition in partitions {
+            if let Err(e) = self
+                .executor
+                .cancel_task(
+                    partition.job_id,
+                    partition.stage_id as usize,
+                    partition.partition_id as usize,
+                )
+                .await
+            {
+                error!("Error cancelling task: {:?}", e);
+                cancelled = false;
+            }
+        }
+
+        Ok(Response::new(CancelTasksResult { cancelled }))
+    }
 }

Review Comment:
   Good to know.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to