Conversation
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
There was a problem hiding this comment.
Pull Request Overview
This PR removes I/O operations from signal handlers to fix a potential deadlock issue (issue #2982). The logging calls that were previously executed directly in the signal handler are now deferred to a separate thread.
- Removed
RCLCPP_INFOandRCLCPP_DEBUGcalls from the signal handler functions - Added
signal_number_atomic variable to pass signal information to the deferred handler - Modified
signal_handler_common()to accept and store the signal number parameter
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| rclcpp/src/rclcpp/signal_handler.hpp | Added signal_number_ atomic member and updated signal_handler_common() signature to accept signal number |
| rclcpp/src/rclcpp/signal_handler.cpp | Removed I/O operations from signal handlers, stored signal number in atomic variable, and moved logging to deferred handler thread |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Pulls: #2986 |
ahcorde
left a comment
There was a problem hiding this comment.
Some signal handler. are failing
|
@ahcorde yeah, i will take a look! thanks |
|
Pulls: #2986, ros2/system_tests#576 |
|
Hm, this patch gets the job done, but It looks like using a std::future would make a cleaner implementation. |
|
@jmachowinski yeah cannot disagree, i will try that with another PR when i have time or maybe |
|
@Mergifyio backport kilted jazzy humble |
✅ Backports have been createdDetails
|
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> (cherry picked from commit 95cb964)
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> (cherry picked from commit 95cb964)
Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> (cherry picked from commit 95cb964) # Conflicts: # rclcpp/src/rclcpp/signal_handler.hpp
Backport of #2986 Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com>
Description
Fixes #2982
Is this user-facing behavior change?
Yes this fixes the possible deadlock via IO.
Did you use Generative AI?
No.
Additional Information
Note
backport required for all downstream distros.