Wake every wait set a condition is attached to #271
I prefer a non-recursive version. What about this? It is not recursive and avoids having to pass the iterator, simplifying the code a lot:
template<typename FunctorT>
void
lock_waitsets_and_update(FunctorT && update_condition)
{
std::vector<std::unique_lock<std::mutex>> locks;
locks.reserve(this->waitsets.size());
for (const auto & waitset : this->waitsets) {
locks.emplace_back(*waitset.first);
}
update_condition();
}
Requested changes.
Getting this merged should get CI back to green.
Thanks for the suggestion. I've applied it https://github.com/ros2/rmw_connextdds/pull/271/commits/31e2d56f1103510db67daf2e4f30d3de23c655e1
CI repos file: https://gist.githubusercontent.com/Yadunund/62882e88df23c7375068cc6bcad1691d/raw/2f3460c86f4a22e613d73f931e2ad50e78b5dec1/ros2.repos
Launcher: https://ci.ros2.org/job/ci_launcher/21425/
Linux 
Linux-aarch64 
Linux-rhel 
Windows 
Getting this merged should get CI back to green.
@mjcarrol my bad for merging the rmw_implementation tests before getting these changes in first. Will push this through.
Approved these changes.
Rerunning as base was outdated and resulted in CI failures.
CI repos file: https://gist.githubusercontent.com/Yadunund/62882e88df23c7375068cc6bcad1691d/raw/2f3460c86f4a22e613d73f931e2ad50e78b5dec1/ros2.repos
Launcher: https://ci.ros2.org/job/ci_launcher/21434/
Linux 
Linux-aarch64 
Linux-rhel 
Windows 
@Yadunund only the Linux build failed hard for unrelated reasons. Windows looks fine, as failing tests do not seem related to the changes here.
fgallegosalido
Yadunund
Description
Addresses same bug as ros2/rmw_zenoh#1109, which was fixed there in ros2/rmw_zenoh#1110. Caught by ros2/rmw_implementation#319, which fails on Connext until this merges.
### Is this user-facing behavior change?
No API change. A node whose entities are briefly in two wait sets no longer stops waking up.
### Did you use Generative AI?
Yes, Claude Opus 5.5 helped write the change. I reviewed and tested it.
### Additional Information
Ubuntu 26.04, rolling, RTI Connext 7.7.0:
-
TestWaitSetSharedEntityfrom ros2/rmw_implementation#319: both cases pass 3/3 with this change. On unmodified rolling both fail 3/3, because the blocked wait set only wakes at its 10 s timeout.- The rest of
test_rmw_implementation(17 binaries) passes with and without the change.-
colcon testofrmw_connextdds_commonandrmw_connextddspasses.- Not covered:
rmw_connextddsmicrowas not built.