mingmwang commented on code in PR #151:
URL: https://github.com/apache/arrow-ballista/pull/151#discussion_r949776805
##########
ballista/rust/executor/src/executor_server.rs:
##########
@@ -289,18 +317,34 @@ impl<T: 'static + AsLogicalPlan, U: 'static +
AsExecutionPlan> Heartbeater<T, U>
Self { executor_server }
}
- async fn start(&self) {
+ fn start(&self, graceful: &Graceful) {
let executor_server = self.executor_server.clone();
+ let mut heartbeat_shutdown = graceful.subscribe_for_shutdown();
+ // Not used directly.
+ let heartbeat_complete = graceful.shutdown_complete_tx.clone();
tokio::spawn(async move {
info!("Starting heartbeater to send heartbeat the scheduler
periodically");
- loop {
+ // Drop and notifies the receiver half that the shutdown is
complete
Review Comment:
Calling the drop explicitly is better in most case, but if the internal loop
has complex branches, we will have to call the drop in all the possible
branches which is error prone.
--
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]