Add timer to action server to check expired goals + asan fixes (#343)

* Add timer to action server to check expired goals

* Fix leak in action_server

* Fix leaks and heap overflow errors

* Fix leaks in tests
This commit is contained in:
Shane Loretz 2018-11-30 18:24:17 -08:00 committed by GitHub
parent 128f28499b
commit fd77323b9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 191 additions and 10 deletions

View file

@ -343,6 +343,8 @@ rcl_action_send_goal_response(
* rcl_action_send_goal_response().
*
* After calling this function, the action server will start tracking the goal.
* The pointer to the goal handle becomes invalid after `rcl_action_server_fini()` is called.
* The caller becomes responsible for finalizing the goal handle later.
*
* Example usage:
*
@ -621,6 +623,28 @@ rcl_action_expire_goals(
size_t expired_goals_capacity,
size_t * num_expired);
/// Notifies action server that a goal handle reached a terminal state.
/**
* <hr>
* Attribute | Adherence
* ------------------ | -------------
* Allocates Memory | No
* Thread-Safe | No
* Uses Atomics | No
* Lock-Free | Yes
*
* \param[in] action_server handle to the action server
* \return `RCL_RET_OK` if everything is ok, or
* \return `RCL_RET_ACTION_SERVER_INVALID` if the action server is invalid, or
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
* \return `RCL_RET_ERROR` if an unspecified error occurs.
*/
RCL_ACTION_PUBLIC
RCL_WARN_UNUSED
rcl_ret_t
rcl_action_notify_goal_done(
const rcl_action_server_t * action_server);
/// Take a pending cancel request using an action server.
/**
* \todo TODO(jacobperron) blocking of take?

View file

@ -258,6 +258,7 @@ rcl_action_client_wait_set_get_entities_ready(
* to take, `false` otherwise
* \param[out] is_result_request_ready `true` if there is a result request message ready
* to take, `false` otherwise
* \param[out] is_goal_expired `true` if there is a goal that expired, `false` otherwise
* \return `RCL_RET_OK` if call is successful, or
* \return `RCL_RET_WAIT_SET_INVALID` if the wait set is invalid, or
* \return `RCL_RET_INVALID_ARGUMENT` if any arguments are invalid, or
@ -272,7 +273,8 @@ rcl_action_server_wait_set_get_entities_ready(
const rcl_action_server_t * action_server,
bool * is_goal_request_ready,
bool * is_cancel_request_ready,
bool * is_result_request_ready);
bool * is_result_request_ready,
bool * is_goal_expired);
#ifdef __cplusplus
}