-
Notifications
You must be signed in to change notification settings - Fork 433
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
revert call shutdown in LifecycleNode destructor #2557
Merged
fujitatomoya
merged 2 commits into
rolling
from
fujitatomoya/revert-shutdown-in-lcnode-dtor
Jun 11, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,37 +152,8 @@ LifecycleNode::LifecycleNode( | |
|
||
LifecycleNode::~LifecycleNode() | ||
{ | ||
auto current_state = LifecycleNode::get_current_state().id(); | ||
// shutdown if necessary to avoid leaving the device in any other primary state | ||
if (current_state < lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED) { | ||
if (node_base_->get_context()->is_valid()) { | ||
auto ret = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn::ERROR; | ||
auto finalized = LifecycleNode::shutdown(ret); | ||
if (finalized.id() != lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED || | ||
ret != rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn::SUCCESS) | ||
{ | ||
RCLCPP_WARN( | ||
rclcpp::get_logger("rclcpp_lifecycle"), | ||
"Shutdown error in destruction of LifecycleNode: final state(%s)", | ||
finalized.label().c_str()); | ||
} | ||
} else { | ||
// TODO(fujitatomoya): consider when context is gracefully shutdown before. | ||
RCLCPP_DEBUG( | ||
rclcpp::get_logger("rclcpp_lifecycle"), | ||
"Context invalid error in destruction of LifecycleNode: Node still in transition state(%u)", | ||
current_state); | ||
} | ||
} else if (current_state > lifecycle_msgs::msg::State::PRIMARY_STATE_FINALIZED) { | ||
RCLCPP_WARN( | ||
rclcpp::get_logger("rclcpp_lifecycle"), | ||
"Shutdown error in destruction of LifecycleNode: Node still in transition state(%u)", | ||
current_state); | ||
} | ||
|
||
// release sub-interfaces in an order that allows them to consult with node_base during tear-down | ||
node_waitables_.reset(); | ||
node_type_descriptions_.reset(); | ||
node_time_source_.reset(); | ||
node_parameters_.reset(); | ||
node_clock_.reset(); | ||
|
@@ -191,7 +162,6 @@ LifecycleNode::~LifecycleNode() | |
node_timers_.reset(); | ||
node_logging_.reset(); | ||
node_graph_.reset(); | ||
node_base_.reset(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is actually bug fix, i will re-submit this after revert as follow-up. |
||
} | ||
|
||
const char * | ||
|
This file contains 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
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.
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.
this is actually bug fix, i will re-submit this after revert as follow-up.