mingmwang commented on code in PR #667:
URL: https://github.com/apache/arrow-ballista/pull/667#discussion_r1121077745
##########
ballista/executor/src/executor_process.rs:
##########
@@ -319,7 +324,41 @@ pub async fn start_executor_process(opt:
ExecutorProcessConfig) -> Result<()> {
},
};
+ // Set status to fenced
+ info!("setting executor to TERMINATING status");
+ TERMINATING.store(true, Ordering::Release);
+
if notify_scheduler {
+ // Send a heartbeat to update status of executor to `Fenced`. This
should signal to the
+ // scheduler to no longer schedule tasks on this executor
+ if let Err(error) = scheduler
+ .heart_beat_from_executor(HeartBeatParams {
+ executor_id: executor_id.clone(),
+ metrics: vec![],
+ status: Some(ExecutorStatus {
+ status: Some(Status::Terminating(String::default())),
+ }),
+ metadata: Some(ExecutorRegistration {
+ id: executor_id.clone(),
+ optional_host: opt
+ .external_host
+ .clone()
+ .map(executor_registration::OptionalHost::Host),
+ port: opt.port as u32,
+ grpc_port: opt.grpc_port as u32,
+ specification: Some(ExecutorSpecification {
+ resources: vec![ExecutorResource {
+ resource:
Some(Resource::TaskSlots(concurrent_tasks as u32)),
+ }],
+ }),
+ }),
+ })
+ .await
+ {
+ error!("error sending heartbeat with fenced status: {:?}", error);
+ }
+
+ // TODO we probably don't need a separate rpc call for this....
if let Err(error) = scheduler
.executor_stopped(ExecutorStoppedParams {
executor_id,
Review Comment:
I think you can remove this RPC call (in the following PR), since this RPC
is only used here.
--
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]