-
Notifications
You must be signed in to change notification settings - Fork 429
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
Test case and fix for for https://github.com/ros2/rclcpp/issues/2652 #2713
base: rolling
Are you sure you want to change the base?
Changes from all commits
76f6215
fb35e0f
4dfdd82
ba78768
27b2d0e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -216,6 +216,11 @@ class DynamicStorage : public rclcpp::wait_set_policies::detail::StoragePolicyCo | |
shared_waitables_ | ||
); | ||
|
||
if(this->needs_pruning_) { | ||
this->storage_prune_deleted_entities(); | ||
this->needs_pruning_ = false; | ||
} | ||
|
||
this->storage_release_ownerships(); | ||
Comment on lines
+219
to
224
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. Should this check and the pruning happen after releasing ownerships? It seems like holding the ownership by the storage might cause the weak pointers to have not expired even though all the user's shared pointers have been destroyed? Maybe it gets caught on the next run through? I suppose this would only happen if something lost all ownership (except the wait set's) after Either way, since 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 needs to happen while holding the ownership, in order to be sure that the indices still match. If you release ownership, and prune, and some references were dropped in between, the indices of the rcl waitset will not match any more the one in the storage. Basically leading to the same bug as before. |
||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -160,6 +160,15 @@ class StaticStorage : public rclcpp::wait_set_policies::detail::StoragePolicyCom | |||||||||
services_, | ||||||||||
waitables_ | ||||||||||
); | ||||||||||
|
||||||||||
if(this->needs_pruning_) { | ||||||||||
// we need to throw here, as the indexing of the rcl_waitset is broken, | ||||||||||
// in case of invalid entries | ||||||||||
|
||||||||||
throw std::runtime_error( | ||||||||||
"StaticStorage : storage_rebuild_rcl_wait_set: Detected" | ||||||||||
" invalid entity in static entity storage"); | ||||||||||
Comment on lines
+169
to
+170
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. Suggested edit, don't block the pr on this:
Suggested change
|
||||||||||
} | ||||||||||
} | ||||||||||
|
||||||||||
// storage_add_subscription() explicitly not declared here | ||||||||||
|
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.
Again, this is weird to me that it passed the linters, I think they may be broken. I'll look into that, but it shouldn't block this pr, we can fix it up in a subsequent pr if that's the case I guess.
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.
Hm, I use the ament_uncrustify and ament_cpplint things, like I use clang_format.
Meaning, I just write code using 'my' coding style and let the auto formaters do their thing later on, and don't look at the format any more after the uncrustify // cpplint.
Is there a better tool for my workflow, that does not produce these strange artifacts ?
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.
that is the same with what i usually do, if there are any coding style problem,
colcon test
(or CI) should say something... i tried this my local environment, all green too. i am not sure what happening here, some rules are changed??? @ros2/team any thoughts?