Graceful shutdown: Handle `SIGTERM`
Is your feature request related to a problem or challenge? Please describe what you are trying to do. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] (This section helps Arrow developers understand the context and why for this feature, in addition to the what)
Right now the executors will gracefully shutdown (deregister with the executor) in response to a SIGINT:
let (notify_scheduler, stop_reason) = tokio::select! {
service_val = check_services(&mut service_handlers) => {
let msg = format!("executor services stopped with reason {:?}", service_val);
info!("{:?}", msg);
(true, msg)
},
_ = signal::ctrl_c() => {
// sometimes OS can not log ??
let msg = "executor received ctrl-c event.".to_string();
info!("{:?}", msg);
(true, msg)
},
_ = stop_recv.recv() => {
(false, "".to_string())
},
};
On kubernetes when a pod terminates it will receive a SIGTERM which doesn't appear to be handled so the executor will not gracefully shutdown.
Describe the solution you'd like A clear and concise description of what you want to happen.
Graceful shutdown on unix systems should initiate graceful shutdown on SIGTERM
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context Add any other context or screenshots about the feature request here.
cc @mingmwang @yahoNanJing
@thinkharderdev Sorry, I didn't get a chance to test it in a K8s cluster. I will take a look today.
https://github.com/apache/arrow-ballista/pull/278