-
Notifications
You must be signed in to change notification settings - Fork 233
Fix: Allow source nodes to wait for stop signal (Fixes #500) #992
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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, thanks a lot! There are some CI failures that are probably caused by the handling of runtime nodes/operators. See my inline comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the adjustments!
|
There is a permission error in CI/ROS2 Bridge Examples. |
|
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. |
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: