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

Add grace duration and kill process #487

Merged
merged 4 commits into from
Apr 30, 2024
Merged

Conversation

haixuanTao
Copy link
Collaborator

This PR adds the grace period before killing making sure that we kill all running process when stopping a dataflow.

This PR is based on sysinfo for checking and killing processes.

Closes #184

@haixuanTao haixuanTao mentioned this pull request Apr 22, 2024
let running_nodes = self.running_nodes.clone();
tokio::spawn(async move {
let duration = grace_duration.unwrap_or(Duration::from_millis(500));
tokio::time::sleep(duration).await;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(probably for future improvements, not for this)

Instead of waiting the entire duration, allow a configurable --stop-timeout that only kills dangling nodes for any StopNodeTask that hasn't finished. The explicit StopNodeTask design TBD.

binaries/daemon/src/spawn.rs Outdated Show resolved Hide resolved
binaries/daemon/src/lib.rs Outdated Show resolved Hide resolved
@phil-opp phil-opp merged commit 7761a61 into main Apr 30, 2024
17 checks passed
@phil-opp phil-opp deleted the stop-grace-period-superseded branch April 30, 2024 12:29
@haixuanTao haixuanTao mentioned this pull request May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants