Fix WaitSetRunner cleanup before propagating callback panics - #660
Open
coolcmyk wants to merge 3 commits into
Open
Fix WaitSetRunner cleanup before propagating callback panics#660coolcmyk wants to merge 3 commits into
coolcmyk wants to merge 3 commits into
Conversation
Add WaitSetRunnerOutcome and send caught panic payloads back to the executor.
Defer resuming a worker panic until all wait set runners have stopped. Store the first panic payload, signal the remaining runners to halt, and trigger their guard conditions so blocked workers can exit. Restore the executor's runners and worker receiver before resuming the panic. This prevents ROS entities from being destroyed while worker threads are still using them, avoiding RMW cleanup errors and crashes.
mxgrey
reviewed
Jul 29, 2026
mxgrey
left a comment
Collaborator
There was a problem hiding this comment.
Let's add UnwindSafe as a trait bound for all callbacks to help ensure that catching the unwind will be safe.
Author
|
Hi mxgrey, i've added cargo test -p rclrs --libtest result: ok. 119 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 3.45s
|
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.
Fixes #613.
A panic inside a callback was caught by its
WaitSetRunner, but the basicexecutor immediately resumed unwinding when it received the panic. This
allowed executor and ROS entities to be destroyed while other runner threads
were still active, causing RMW cleanup errors and potentially a segmentation
fault.
This change:
WaitSetRunneras a distinct outcome.The panic still propagates to the caller, but worker shutdown and ROS resource
cleanup now happen first.
Validation
cargo check -p rclrs --lib.errors or segmentation fault.
catch_unwind.