Fix: Allow source nodes to wait for stop signal (Fixes #500)#992
Closed
ZhangHanDong wants to merge 7 commits intodora-rs:mainfrom
Closed
Fix: Allow source nodes to wait for stop signal (Fixes #500)#992ZhangHanDong wants to merge 7 commits intodora-rs:mainfrom
ZhangHanDong wants to merge 7 commits intodora-rs:mainfrom
Conversation
phil-opp
reviewed
May 21, 2025
Collaborator
phil-opp
left a comment
There was a problem hiding this comment.
Looks good to me overall, thanks a lot! There are some CI failures that are probably caused by the handling of runtime nodes/operators. See my inline comment.
phil-opp
reviewed
May 28, 2025
Collaborator
phil-opp
left a comment
There was a problem hiding this comment.
Thanks for the adjustments!
Author
|
There is a permission error in CI/ROS2 Bridge Examples. |
Author
|
This CI might have some issues. I didn’t update the code for the past two weeks, but the CI kept running continuously for two weeks without showing any error messages. |
This was referenced Jan 12, 2026
Collaborator
haixuanTao
added a commit
that referenced
this pull request
Jan 16, 2026
This keeps the event channel open for source nodes so that they can receive manual stop events. It also simplifies our policy around dealing with event stream closure: All nodes (including source nodes) should now exit once the event stream closes (i.e. after receiving a stop event of any kind). Note that this is technically a _breaking change_. However, we don't expect that there are nodes that rely on the immediate stop event and event stream closure. Because of this, we plan to treat this as a bugfix without doing a semver-breaking release. We should mention it prominently in the release docs though. Alternative to #992 Fixes #500
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixed #500
Currently, source (input-less) Dora nodes close their event stream immediately after startup, making them unable to receive an
Event::Stopsignal (such as fromCtrl+Cor dora stop). This prevents graceful shutdown.Solution:
A new optional node configuration field,
wait_for_stop: bool, is introduced to control event stream behavior after all inputs are closed:wait_for_stop: false: The event stream ends when all inputs are closed (default for nodes with inputs; unchanged).wait_for_stop: true: The event stream remains open until an explicitEvent::Stop signal is received (default for source nodes with no inputs).Users can override the default by setting this option explicitly in the dataflow YAML file.
Key Changes:
wait_for_stop: Option<bool> to descriptor::Node for YAML parsing.wait_for_stop: boolto descriptor::ResolvedNode to store the resolved value.descriptor::resolve_aliases_and_set_defaults to compute the finalResolvedNode.wait_for_stopvalue based on inputs and YAML settings. Fixed related ownership bug.ResolvedNode.wait_for_stop to the node communication listener (node_communication::spawn_listener_loop and implementation).node_communication::Listener) to check the wait_for_stopflag when deciding whether to send AllInputsClosed or end the event stream. The event stream now only ends naturally if wait_for_stop is false.Event::Stop, regardless of wait_for_stop.dora-schema.json to include thewait_for_stopfield.Impact:
Todos:
Todo Test: