thinkharderdev opened a new issue, #655:
URL: https://github.com/apache/arrow-ballista/issues/655

   **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*)
   
   While working on the cluster state refactor and observing some issues with 
handling of lost executors in our system, I think there are a couple of issues 
with the current approach:
   
   1. In multi-scheduler deployments, an executor will register itself and send 
heartbeats with a particular scheduler.
   2. Any scheduler can scheduler tasks on the executor
   3. However, in the case of a `SIGTERM` the executor will call 
`executor_stopped` on the scheduler from 1. 
   
   This doesn't work particularly well with the curated task architecture since 
the scheduler from step 1 may not be the owner of the jobs which the executor 
is running when it gets the `SIGTERM`. At best this may cause the lost executor 
handling to not work correctly (or be delayed since the owning scheduler has to 
wait for a timeout). At worst it could corrupt the job state and cause 
unpredictable errors in the scheduler.   
   
   More broadly, resetting tasks immediately when an executor gets a `SIGTERM` 
is a bit limiting. The executor may have anywhere from 30s - 2 minutes (or 
maybe more) to cleanup and finish any existing work after receiving a `SIGTERM` 
and ideally we could take advantage of that to minimize disruptions. 
   
   **Describe the solution you'd like**
   A clear and concise description of what you want to happen.
   
   We have an existing mechanism to broadcast executor state to all schedulers 
using the executor heartbeat. These will also go to a particular scheduler but 
can be broadcast fairly easily through `ClusterState`. So I would propose the 
following:
   
   1. Remove the `executor_stopped` rpc.
   2. Instead of sending the `executor_stopped` rpc on `SIGTERM` the executor 
can just send a heartbeat where it's state changes from `Active` to `Dead` (or 
maybe something more descriptive like `ShuttingDown`).
   3. When receiving that heartbeat the scheduler can put that executor in a 
"quarantine" state which means:
      a. Stop scheduling new tasks on it
      b. Wait for some (configurable) interval before resetting tasks
   
   This can ensure that we handle job updates on the appropriate scheduler and 
that we can attempt to finish outstanding work before potentially re-computing 
tasks/stages. 
   
   **Describe alternatives you've considered**
   A clear and concise description of any alternative solutions or features 
you've considered.
   
   The executor could maybe track all schedulers for which it has active tasks 
and send an `executor_stopped` rpc to all of them but the rpc itself seems 
somewhat duplicative of the existing heartbeat mechanism
   
   **Additional context**
   Add any other context or screenshots about the feature request 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]

Reply via email to