Skip to content

Preserve wait-set ownership when removal fails - #3294

Open
Miko997 wants to merge 1 commit into
ros2:rollingfrom
Miko997:fix/wait-set-removal-ownership
Open

Miko997 wants to merge 1 commit into
ros2:rollingfrom
Miko997:fix/wait-set-removal-ownership

Conversation

@Miko997

@Miko997 Miko997 commented Sep 30, 2026

Copy link
Copy Markdown

Description

Clear wait-set ownership only after storage removal succeeds, retaining shared pointers for the ownership update. Regression coverage exercises the same defect in guard-condition, timer, client, service, waitable and subscription-part removal.

Fixes #3293.

Is this user-facing behavior change?

Failed removal from a non-owner preserves ownership, so another wait set still rejects the entity. Successful removal by the owner permits reuse.

Did you use Generative AI?

Generated-by: OpenAI Codex (GPT-6).

The implementation, regression tests and PR text were generated with AI assistance.

Additional Information

Local validation on Ubuntu 26.04 x86_64, Rolling, rmw_fastrtps_cpp, using the rebuilt checkout:

  • Both regressions fail on eee4b508 and pass with the fix.
  • All 43 tests in test_wait_set, test_dynamic_storage, test_static_storage, test_storage_policy_common and test_thread_safe_synchronization pass.
  • Copyright, cpplint, CMake lint, uncrustify and XML lint pass; git diff --check passes.
  • The standalone issue reproducer exits 0 with all three checks true (CMake linking adapted for Rolling).
  • Forced cppcheck 2.19.0 analysis reports three findings in untouched files, reproduced on the pristine base. The default ament check skips this version for known performance issues.

Tier-1 CI remains a maintainer-run gate.

Release ownership only after storage removal succeeds, keeping shared
pointers valid for the state update. Cover failed non-owner removal and
successful reuse for all affected entity and subscription-part paths.

Fixes ros2#3293.

Generated-by: OpenAI Codex (GPT-6).
Signed-off-by: Miko Parkkinen <Miko.parkkinen99@gmail.com>
@fujitatomoya

Copy link
Copy Markdown
Collaborator

Pulls: #3294
Gist: https://gist.githubusercontent.com/fujitatomoya/caa61e8a6dcb8ae292daafe1a62c5498/raw/1a5608fa76e7f3d53c443d76bbc9b4eead488a92/ros2.repos
BUILD args: --packages-above-and-dependencies rclcpp
TEST args: --packages-above rclcpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/20641

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

ABI Compliance Check

❌ Verdict: incompatible

Library Verdict Summary
libcomponent_manager.so ✅ compatible No ABI changes detected.
librclcpp.so ❌ incompatible ABI-incompatible changes detected.
librclcpp_action.so ❌ incompatible ABI-incompatible changes detected.
librclcpp_lifecycle.so ✅ compatible No ABI changes detected.
✅ libcomponent_manager.so — full abidiff report

Compared:

  • Base: lib-base/libcomponent_manager.so
  • Head: lib-pr/libcomponent_manager.so @ a0df585
(empty report — no differences printed by abidiff)
❌ librclcpp.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp.so
  • Head: lib-pr/librclcpp.so @ a0df585
Functions changes summary: 10 Removed (46 filtered out), 2 Changed (134 filtered out), 2 Added (3 filtered out) functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
Function symbols changes summary: 4 Removed, 2 Added function symbols not referenced by debug info
Variable symbols changes summary: 0 Removed, 0 Added variable symbol not referenced by debug info

10 Removed functions:

  [D] 'method void rclcpp::executors::cbg_executor::CBGScheduler::block_worker_thread(rclcpp::executors::cbg_executor::Worker*)'    {_ZN6rclcpp9executors12cbg_executor12CBGScheduler19block_worker_threadEPNS1_6WorkerE}
  [D] 'method void rclcpp::executors::cbg_executor::CBGScheduler::block_worker_thread_for(rclcpp::executors::cbg_executor::Worker*, std::chrono::nanoseconds)'    {_ZN6rclcpp9executors12cbg_executor12CBGScheduler23block_worker_thread_forEPNS1_6WorkerENSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE}
  [D] 'method bool rclcpp::executors::cbg_executor::CBGScheduler::prepare_and_enqueue_worker(rclcpp::executors::cbg_executor::Worker*)'    {_ZN6rclcpp9executors12cbg_executor12CBGScheduler26prepare_and_enqueue_workerEPNS1_6WorkerE}
  [D] 'method void rclcpp::executors::cbg_executor::CBGScheduler::suppress_thread_wakeup()'    {_ZN6rclcpp9executors12cbg_executor12CBGScheduler22suppress_thread_wakeupEv}
  [D] 'method void rclcpp::executors::cbg_executor::Worker::block()'    {_ZN6rclcpp9executors12cbg_executor6Worker5blockEv}
  [D] 'method void rclcpp::executors::cbg_executor::Worker::block_for(std::chrono::nanoseconds)'    {_ZN6rclcpp9executors12cbg_executor6Worker9block_forENSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE}
  [D] 'method void rclcpp::executors::cbg_executor::Worker::unblock()'    {_ZN6rclcpp9executors12cbg_executor6Worker7unblockEv}
  [D] 'method void rclcpp::executors::cbg_executor::Worker::unblock_thread_safe()'    {_ZN6rclcpp9executors12cbg_executor6Worker19unblock_thread_safeEv}
  [D] 'method rclcpp::executors::cbg_executor::Worker* rclcpp::executors::cbg_executor::WorkerQueue::pop_blocked_worker_thread()'    {_ZN6rclcpp9executors12cbg_executor11WorkerQueue25pop_blocked_worker_threadEv}
  [D] 'method void rclcpp::executors::cbg_executor::WorkerQueue::remove_worker_thread(rclcpp::executors::cbg_executor::Worker*)'    {_ZN6rclcpp9executors12cbg_executor11WorkerQueue20remove_worker_threadEPNS1_6WorkerE}

2 Added functions:

  [A] 'method void rclcpp::executors::cbg_executor::CBGScheduler::block_worker_thread()'    {_ZN6rclcpp9executors12cbg_executor12CBGScheduler19block_worker_threadEv}
  [A] 'method void rclcpp::executors::cbg_executor::CBGScheduler::block_worker_thread_for(std::chrono::nanoseconds)'    {_ZN6rclcpp9executors12cbg_executor12CBGScheduler23block_worker_thread_forENSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEE}

2 functions with some indirect sub-type change:

  [C] 'method rclcpp::executors::cbg_executor::CBGScheduler::CBGScheduler(std::function<void()>)' at scheduler.hpp:326:1 has some indirect sub-type changes:
    implicit parameter 0 of type 'rclcpp::executors::cbg_executor::CBGScheduler*' has sub-type changes:
      in pointed to type 'class rclcpp::executors::cbg_executor::CBGScheduler' at scheduler.hpp:32:1:
        type size changed from 2624 to 1984 (in bits)
        1 member function insertion:
          'method virtual rclcpp::executors::cbg_executor::CBGScheduler::~CBGScheduler()' at scheduler.hpp:199:1
        no member function changes (6 filtered);
        2 data member insertions:
          'bool release_workers', at offset 1344 (in bits) at scheduler.hpp:393:1
          'bool release_worker_once', at offset 1352 (in bits) at scheduler.hpp:394:1
        3 data member changes (1 filtered):
          name of 'rclcpp::executors::cbg_executor::CBGScheduler::worker_queue' changed to 'rclcpp::executors::cbg_executor::CBGScheduler::work_ready_conditional' at scheduler.hpp:397:1, size changed from 1024 to 384 (in bits) (by -640 bits)
          'bool worker_checking_for_work' offset changed from 1344 to 1360 (in bits) (by +16 bits)
          'std::__cxx11::list<std::unique_ptr<rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle, std::default_delete<rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle> >, std::allocator<std::unique_ptr<rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle, std::default_delete<rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle> > > > callback_groups' offset changed from 2432 to 1792 (in bits) (by -640 bits)

  [C] 'method virtual std::unique_ptr<rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle, std::default_delete<rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle> > rclcpp::executors::cbg_executor::FirstInFirstOutScheduler::get_handle_for_callback_group(const rclcpp::CallbackGroup::SharedPtr&)' at first_in_first_out_scheduler.cpp:149:1 has some indirect sub-type changes:
    implicit parameter 0 of type 'rclcpp::executors::cbg_executor::FirstInFirstOutScheduler*' has sub-type changes:
      in pointed to type 'class rclcpp::executors::cbg_executor::FirstInFirstOutScheduler' at first_in_first_out_scheduler.hpp:66:1:
        type size changed from 2816 to 2176 (in bits)
        1 base class change:
          'class rclcpp::executors::cbg_executor::CBGScheduler' at scheduler.hpp:163:1 changed:
            details were reported earlier
        no member function changes (3 filtered);
        1 data member change:
          'std::vector<std::unique_ptr<rclcpp::executors::cbg_executor::FirstInFirstOutCallbackGroupHandle, std::default_delete<rclcpp::executors::cbg_executor::FirstInFirstOutCallbackGroupHandle> >, std::allocator<std::unique_ptr<rclcpp::executors::cbg_executor::FirstInFirstOutCallbackGroupHandle, std::default_delete<rclcpp::executors::cbg_executor::FirstInFirstOutCallbackGroupHandle> > > > callback_group_handles' offset changed from 2624 to 1984 (in bits) (by -640 bits)

4 Removed function symbols not referenced by debug info:

  [D] _ZN6rclcpp9executors12cbg_executor11WorkerQueueC1Ev
  [D] _ZN6rclcpp9executors12cbg_executor11WorkerQueueC2Ev, aliases _ZN6rclcpp9executors12cbg_executor11WorkerQueueC1Ev
  [D] _ZN6rclcpp9executors12cbg_executor6WorkerC1Ev, aliases _ZN6rclcpp9executors12cbg_executor6WorkerC2Ev
  [D] _ZN6rclcpp9executors12cbg_executor6WorkerC2Ev

2 Added function symbols not referenced by debug info:

  [A] _ZZN6rclcpp9executors12cbg_executor12CBGScheduler19block_worker_threadEvENKUlvE_clEv
  [A] _ZZN6rclcpp9executors12cbg_executor12CBGScheduler23block_worker_thread_forENSt6chrono8durationIlSt5ratioILl1ELl1000000000EEEEENKUlvE_clEv


❌ librclcpp_action.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp_action.so
  • Head: lib-pr/librclcpp_action.so @ a0df585
Functions changes summary: 2 Removed (5 filtered out), 0 Changed, 0 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable
Function symbols changes summary: 3 Removed, 0 Added function symbols not referenced by debug info
Variable symbols changes summary: 3 Removed, 0 Added variable symbols not referenced by debug info

2 Removed functions:

  [D] 'method rclcpp_action::GoalStatusCode rclcpp_action::GenericClientGoalHandle::get_status_code()'    {_ZN13rclcpp_action23GenericClientGoalHandle15get_status_codeEv}
  [D] 'method rclcpp_action::exceptions::InvalidGoalStatusError::InvalidGoalStatusError(int8_t)'    {_ZN13rclcpp_action10exceptions22InvalidGoalStatusErrorC2Ea, aliases _ZN13rclcpp_action10exceptions22InvalidGoalStatusErrorC1Ea}

3 Removed function symbols not referenced by debug info:

  [D] _ZN13rclcpp_action10exceptions22InvalidGoalStatusErrorD0Ev
  [D] _ZN13rclcpp_action10exceptions22InvalidGoalStatusErrorD1Ev
  [D] _ZN13rclcpp_action10exceptions22InvalidGoalStatusErrorD2Ev, aliases _ZN13rclcpp_action10exceptions22InvalidGoalStatusErrorD1Ev

3 Removed variable symbols not referenced by debug info:

  [D] _ZTIN13rclcpp_action10exceptions22InvalidGoalStatusErrorE
  [D] _ZTSN13rclcpp_action10exceptions22InvalidGoalStatusErrorE
  [D] _ZTVN13rclcpp_action10exceptions22InvalidGoalStatusErrorE


✅ librclcpp_lifecycle.so — full abidiff report

Compared:

  • Base: lib-base/librclcpp_lifecycle.so
  • Head: lib-pr/librclcpp_lifecycle.so @ a0df585
(empty report — no differences printed by abidiff)

Updated for commit a0df585 · suppressions: /home/runner/work/_temp/ros2-abi-suppressions.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WaitSet failed remove clears entity ownership and permits the same guard condition in two wait sets

3 participants