fix: Fixed race condition in action server between is_ready and take_… #2248
+84
−64
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.
…data and execute
Some background information: is_ready and take_data are guaranteed to be called in sequence without interruption from another thread. while execute is running, another thread may also call is_ready.
The problem was, that goal_request_ready_, cancel_request_ready_, result_request_ready_ and goal_expired_ were accessed and written from is_ready and execute.
This commit fixed this by only using the mentioned variables in is_ready and take_data. execute now only accesses the given pointer and works on this.
Note, this fixes parts of #2242