Skip to content

Commit

Permalink
fix(rclcpp_action): Fixed race condition in Client
Browse files Browse the repository at this point in the history
Some background information: is_ready, take_data and execute data
may be called from different threads in any order. The code in the old
state expected them to be called in series, without interruption.
This lead to multiple race conditions, as the state of the pimpl objects
was altered by the three functions in a non thread safe way.

This commit fixed this by
 - Introducing a data queue that is filled in is_ready
 - take_data from now only pops the front element of the data queue
 - A backlog of events if held in num_unreported_events_ which will be
   reported by future calls of is_ready

Signed-off-by: Janosch Machowinski <[email protected]>
  • Loading branch information
Janosch Machowinski authored and Janosch Machowinski committed Aug 1, 2023
1 parent 85f1c48 commit 76ac33e
Show file tree
Hide file tree
Showing 2 changed files with 334 additions and 128 deletions.
Loading

0 comments on commit 76ac33e

Please sign in to comment.