Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graceful shutdown: Handle SIGTERM #266

Closed
thinkharderdev opened this issue Sep 23, 2022 · 3 comments · Fixed by #278
Closed

Graceful shutdown: Handle SIGTERM #266

thinkharderdev opened this issue Sep 23, 2022 · 3 comments · Fixed by #278
Labels
enhancement New feature or request

Comments

@thinkharderdev
Copy link
Contributor

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.

@thinkharderdev thinkharderdev added the enhancement New feature or request label Sep 23, 2022
@thinkharderdev
Copy link
Contributor Author

cc @mingmwang @yahoNanJing

@mingmwang
Copy link
Contributor

@thinkharderdev Sorry, I didn't get a chance to test it in a K8s cluster. I will take a look today.

@mingmwang
Copy link
Contributor

#278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants