Skip to content

Enhance dataflow stop procedure#1190

Merged
phil-opp merged 6 commits intodora-rs:mainfrom
Mivik:stop
Nov 13, 2025
Merged

Enhance dataflow stop procedure#1190
phil-opp merged 6 commits intodora-rs:mainfrom
Mivik:stop

Conversation

@Mivik
Copy link
Copy Markdown
Contributor

@Mivik Mivik commented Nov 12, 2025

Description

See the discussion for more details.

This PR implements the three-phase stop procedure described in the discussion. This significantly improves the current state where dataflows are often difficult to stop gracefully.

process-wrap crate is used to organize processes into groups (process group on Unix and JobObject on Windows). This ensures that all descendant processes are reliably terminated as soon as the root process is killed.

Additionally, a force: bool argument has been added to the stop command, enabling instant process termination. When a dataflow is launched via dora start, pressing Ctrl-C twice will now send a force stop request to the daemon, mirroring the behavior found in Docker.

Backward compatibility

The force argument has been added to several message types, and #[serde(default)] is used to ensure backward compatibility with existing implementations.

@haixuanTao
Copy link
Copy Markdown
Collaborator

Could add more code documentation on the kill logic with links to the related fixes as it's pretty hard to follow through the code.

Copy link
Copy Markdown
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Looks good to me overall!

Some additonal docs on the CLI force flag would be nice. As I understand it, the normal stop command would wait for the grace duration and then try a soft kill first before doing a hard kill of the whole process group. A force stop would kill the process group directly without waiting. Am I understanding this correctly?

Copy link
Copy Markdown
Collaborator

@phil-opp phil-opp left a comment

Choose a reason for hiding this comment

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

Thank you!

@phil-opp phil-opp merged commit 71f33e7 into dora-rs:main Nov 13, 2025
50 checks passed
@Mivik Mivik deleted the stop branch November 17, 2025 05:43
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.

3 participants