yahoNanJing commented on code in PR #188:
URL: https://github.com/apache/arrow-ballista/pull/188#discussion_r966539528


##########
ballista/rust/scheduler/src/scheduler_server/grpc.rs:
##########
@@ -481,16 +482,20 @@ impl<T: 'static + AsLogicalPlan, U: 'static + 
AsExecutionPlan> SchedulerGrpc
         let job_id = request.into_inner().job_id;
         info!("Received cancellation request for job {}", job_id);
 
-        self.state
-            .task_manager
-            .cancel_job(&job_id, &self.state.executor_manager)
+        self.query_stage_event_loop
+            .get_sender()
+            .map_err(|e| {
+                let msg = format!("Get query stage event loop error due to 
{:?}", e);
+                error!("{}", msg);
+                Status::internal(msg)
+            })?
+            .post_event(QueryStageSchedulerEvent::JobCancel(job_id))

Review Comment:
   Nice refinement. It's better to have only one entrance to modify the 
scheduler state and all of the state changes should have a related event and be 
dealt with in the event loop.



-- 
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