-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up error handling in many rcl{_action,_lifecycle} codepaths #1202
Clean up error handling in many rcl{_action,_lifecycle} codepaths #1202
Conversation
Instead of waiting 250ms between setting up 10 goals (for at least 2.5 seconds), just wait 100ms which reduces this to 1 second. Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
That is, if rcutils_hash_map_set() fails, it sets its own error, so overriding it with our own will cause a warning to print. Make sure to clear it before setting our own. Signed-off-by: Chris Lalancette <[email protected]>
This avoids a warning on cleanup in rcl_timer_init2. Signed-off-by: Chris Lalancette <[email protected]>
Otherwise, in a failure situation we set the error but we actually return RCL_RET_OK to the upper layers, which is odd. Signed-off-by: Chris Lalancette <[email protected]>
This generated code was translating an RCL error to an RCL error, which doesn't make much sense. Just remove the duplicate code. Signed-off-by: Chris Lalancette <[email protected]>
Rather than starting it enabled, and then immediately canceling it. Signed-off-by: Chris Lalancette <[email protected]>
It already sets the error, so rcl_action_server_goal_exists() should not set it again. Signed-off-by: Chris Lalancette <[email protected]>
That way we avoid an ugly warning in the error paths. Signed-off-by: Chris Lalancette <[email protected]>
That way when we go to cleanup in the "fail" case, the options actually exist and are valid. This avoids an ugly warning during cleanup. Signed-off-by: Chris Lalancette <[email protected]>
This makes it match the generated code for the action_client. Signed-off-by: Chris Lalancette <[email protected]>
That way subsequent failures won't print out ugly error strings. Signed-off-by: Chris Lalancette <[email protected]>
That is, if rcl_lexer_lookahead2_expect() returns an error, we should pass that along to higher layers rather than just ignoring it. Signed-off-by: Chris Lalancette <[email protected]>
It leads to ugly warnings. Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Otherwise we get a warning about overwriting the error from rcutils_hash_map_init. Signed-off-by: Chris Lalancette <[email protected]>
Only when rcl_context_is_valid doesn't set the error. Signed-off-by: Chris Lalancette <[email protected]>
It already sets the error in the failure case. Signed-off-by: Chris Lalancette <[email protected]>
That's because some of the RMW implementations may not support this feature, and thus set errors. Signed-off-by: Chris Lalancette <[email protected]>
That way we can set more useful errors for the upper layers. Signed-off-by: Chris Lalancette <[email protected]>
In particular, make sure to not overwrite errors as we get into error-handling paths, which should clean up warnings we get. Signed-off-by: Chris Lalancette <[email protected]>
That way we won't get ugly "overwritten" warnings on subsequent tests. Signed-off-by: Chris Lalancette <[email protected]>
Pulls: #1202 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but a couple of comments.
The original impetus from this PR came from running the
rcl
tests, and seeing output like the following on the console:There are 2 main reasons why this can happen:
rcl_reset_error()
before trying another condition.This PR corrects almost all instances of this occurence in the rcl libraries, with the exception of
test_arguments
, which has quite a few of these and will require a separate PR. Not only will this quite down many of the tests, it also fixes some bugs in error handling in this code.